Interface Command


public interface Command
Represents a command.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Method Summary

    Modifier and Type
    Method
    Description
    Gets the aliases for this command, as an unmodifiable list
    static <T extends CommandSource>
    Command.Builder<T>
    builder(Extension extension)
    Creates a new Command.Builder used to construct commands.
    Gets the command description.
    boolean
     
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.4.1: use isPlayerOnly() instead (inverted)
    boolean
     
    default boolean
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.4.1: this method is not guaranteed to provide meaningful or expected results.
    Gets the command name.
    Gets the permission node associated with this command.
    default List<String>
    Deprecated, for removal: This API element is subject to removal in a future version.
    since 2.4.1: this method will always return an empty immutable list
  • Method Details

    • name

      String name()
      Gets the command name.
      Returns:
      the command name
    • description

      String description()
      Gets the command description.
      Returns:
      the command description
    • permission

      String permission()
      Gets the permission node associated with this command.
      Returns:
      the permission node for this command if defined, otherwise an empty string
    • aliases

      List<String> aliases()
      Gets the aliases for this command, as an unmodifiable list
      Returns:
      the aliases for this command as an unmodifiable list
    • isSuggestedOpOnly

      @Deprecated(since="2.4.1", forRemoval=true) default boolean isSuggestedOpOnly()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.4.1: this method is not guaranteed to provide meaningful or expected results.
      Gets if this command is designed to be used only by server operators.

      This method is deprecated for removal and will be removed in Geyser 2.13.0.

      Returns:
      if this command is designated to be used only by server operators.
    • isExecutableOnConsole

      @Deprecated(since="2.4.1", forRemoval=true) default boolean isExecutableOnConsole()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.4.1: use isPlayerOnly() instead (inverted)
      This method is deprecated for removal and will be removed in Geyser 2.13.0.
      Returns:
      true if this command is executable on console
    • isPlayerOnly

      boolean isPlayerOnly()
      Returns:
      true if this command can only be used by players
    • isBedrockOnly

      boolean isBedrockOnly()
      Returns:
      true if this command can only be used by Bedrock players
    • subCommands

      @Deprecated(since="2.4.1", forRemoval=true) default List<String> subCommands()
      Deprecated, for removal: This API element is subject to removal in a future version.
      since 2.4.1: this method will always return an empty immutable list
      This method is deprecated for removal and will be removed in Geyser 2.13.0.
    • builder

      static <T extends CommandSource> Command.Builder<T> builder(Extension extension)
      Creates a new Command.Builder used to construct commands.
      Type Parameters:
      T - the source type
      Parameters:
      extension - the extension
      Returns:
      a new command builder used to construct commands