Interface CommandSender

All Known Subinterfaces:
ConnectedPlayer, ProxiedPlayer

public interface CommandSender
  • Method Details

    • getName

      String getName()
      Get the unique name of this command sender.
      Returns:
      the senders username
    • sendMessage

      @Deprecated void sendMessage(String message)
      Deprecated.
      Send a message to this sender.
      Parameters:
      message - the message to send
    • sendMessages

      @Deprecated void sendMessages(String... messages)
      Deprecated.
      Send several messages to this sender. Each message will be sent separately.
      Parameters:
      messages - the messages to send
    • sendMessage

      void sendMessage(BaseComponent... message)
      Send a message to this sender.
      Parameters:
      message - the message to send
    • sendMessage

      void sendMessage(BaseComponent message)
      Send a message to this sender.
      Parameters:
      message - the message to send
    • getGroups

      Collection<String> getGroups()
      Get all groups this user is part of. This returns an unmodifiable collection.
      Returns:
      the users groups
    • addGroups

      void addGroups(String... groups)
      Adds groups to a this user for the current session only.
      Parameters:
      groups - the groups to add
    • removeGroups

      void removeGroups(String... groups)
      Remove groups from this user for the current session only.
      Parameters:
      groups - the groups to remove
    • hasPermission

      boolean hasPermission(String permission)
      Checks if this user has the specified permission node.
      Parameters:
      permission - the node to check
      Returns:
      whether they have this node
    • setPermission

      void setPermission(String permission, boolean value)
      Set a permission node for this user.
      Parameters:
      permission - the node to set
      value - the value of the node
    • getPermissions

      Collection<String> getPermissions()
      Get all Permissions which this CommandSender has
      Returns:
      a unmodifiable Collection of Strings which represent their permissions