Interface Sender

All Known Implementing Classes:
AbstractSender, DummyConsoleSender

public interface Sender
Wrapper interface to represent a CommandSender/CommandSource within the common command implementations.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
    The name used by the console sender.
    static final UUID
    The uuid used by the console sender.
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the sender's username
    default String
    Gets a string representing the senders username, and their current location within the network.
    net.luckperms.api.util.Tristate
    Gets the tristate a permission is set to.
    Gets the plugin instance the sender is from.
    Gets the sender's unique id.
    boolean
    hasPermission(String permission)
    Check if the Sender has a permission.
    boolean
    Check if the Sender has a permission.
    boolean
    Gets whether this sender is the console
    default boolean
    Gets whether this sender is still valid invalid input: '&' receiving messages.
    void
    performCommand(String commandLine)
    Makes the sender perform a command.
    void
    sendMessage(net.kyori.adventure.text.Component message)
    Send a json message to the Sender.
  • Field Details

    • CONSOLE_UUID

      static final UUID CONSOLE_UUID
      The uuid used by the console sender.
    • CONSOLE_NAME

      static final String CONSOLE_NAME
      The name used by the console sender.
      See Also:
  • Method Details

    • getPlugin

      LuckPermsPlugin getPlugin()
      Gets the plugin instance the sender is from.
      Returns:
      the plugin
    • getName

      String getName()
      Gets the sender's username
      Returns:
      a friendly username for the sender
    • getNameWithLocation

      default String getNameWithLocation()
      Gets a string representing the senders username, and their current location within the network.
      Returns:
      a friendly identifier for the sender
    • getUniqueId

      UUID getUniqueId()
      Gets the sender's unique id.

      See CONSOLE_UUID for the console's UUID representation.

      Returns:
      the sender's uuid
    • sendMessage

      void sendMessage(net.kyori.adventure.text.Component message)
      Send a json message to the Sender.
      Parameters:
      message - the message to send.
    • getPermissionValue

      net.luckperms.api.util.Tristate getPermissionValue(String permission)
      Gets the tristate a permission is set to.
      Parameters:
      permission - the permission to check for
      Returns:
      a tristate
    • hasPermission

      boolean hasPermission(String permission)
      Check if the Sender has a permission.
      Parameters:
      permission - the permission to check for
      Returns:
      true if the sender has the permission
    • hasPermission

      boolean hasPermission(CommandPermission permission)
      Check if the Sender has a permission.
      Parameters:
      permission - the permission to check for
      Returns:
      true if the sender has the permission
    • performCommand

      void performCommand(String commandLine)
      Makes the sender perform a command.
      Parameters:
      commandLine - the command
    • isConsole

      boolean isConsole()
      Gets whether this sender is the console
      Returns:
      if the sender is the console
    • isValid

      default boolean isValid()
      Gets whether this sender is still valid invalid input: '&' receiving messages.
      Returns:
      if this sender is valid