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

    • name

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

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

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

      @NonNull 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(forRemoval=true) default boolean isSuggestedOpOnly()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method is not guaranteed to provide meaningful or expected results.
      Gets if this command is designed to be used only by server operators.
      Returns:
      if this command is designated to be used only by server operators.
    • isExecutableOnConsole

      @Deprecated(forRemoval=true) default boolean isExecutableOnConsole()
      Deprecated, for removal: This API element is subject to removal in a future version.
      use isPlayerOnly() instead (inverted)
      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(forRemoval=true) default @NonNull List<String> subCommands()
      Deprecated, for removal: This API element is subject to removal in a future version.
      this method will always return an empty immutable list
    • builder

      static <T extends CommandSource> Command.Builder<T> builder(@NonNull 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