Interface CommandSender

All Known Subinterfaces:
ConnectedPlayer, ProxiedPlayer

public interface CommandSender
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addGroups(String... groups)
    Adds groups to a this user for the current session only.
    Get all groups this user is part of.
    Get the unique name of this command sender.
    boolean
    hasPermission(String permission)
    Checks if this user has the specified permission node.
    void
    removeGroups(String... groups)
    Remove groups from this user for the current session only.
    void
    Send a message to this sender.
    void
    sendMessages(String... messages)
    Send several messages to this sender.
    void
    setPermission(String permission, boolean value)
    Set a permission node for this user.
  • Method Details

    • getName

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

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

      void sendMessages(String... messages)
      Send several messages to this sender. Each message will be sent separately.
      Parameters:
      messages - the messages 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