Interface Command.Builder<T extends CommandSource>

Enclosing interface:
Command

public static interface Command.Builder<T extends CommandSource>
  • Method Details

    • source

      Command.Builder<T> source(@NonNull Class<? extends T> sourceType)
      Defines the source type to use for this command.

      Command source types can be anything that extend CommandSource, such as GeyserConnection. This will guarantee that the source used in the executor is an instance of this source.

      Parameters:
      sourceType - the source type
      Returns:
      the builder
    • name

      Command.Builder<T> name(@NonNull String name)
      Sets the command name.
      Parameters:
      name - the command name
      Returns:
      the builder
    • description

      Command.Builder<T> description(@NonNull String description)
      Sets the command description.
      Parameters:
      description - the command description
      Returns:
      the builder
    • permission

      Command.Builder<T> permission(@NonNull String permission)
      Sets the permission node.
      Parameters:
      permission - the permission node
      Returns:
      the builder
    • aliases

      Command.Builder<T> aliases(@NonNull List<String> aliases)
      Sets the aliases.
      Parameters:
      aliases - the aliases
      Returns:
      the builder
    • suggestedOpOnly

      Command.Builder<T> suggestedOpOnly(boolean suggestedOpOnly)
      Sets if this command is designed to be used only by server operators.
      Parameters:
      suggestedOpOnly - if this command is designed to be used only by server operators
      Returns:
      the builder
    • executableOnConsole

      Command.Builder<T> executableOnConsole(boolean executableOnConsole)
      Sets if this command is executable on console.
      Parameters:
      executableOnConsole - if this command is executable on console
      Returns:
      the builder
    • subCommands

      Command.Builder<T> subCommands(@NonNull List<String> subCommands)
      Sets the subcommands.
      Parameters:
      subCommands - the subcommands
      Returns:
      the builder
    • bedrockOnly

      Command.Builder<T> bedrockOnly(boolean bedrockOnly)
      Sets if this command is bedrock only.
      Parameters:
      bedrockOnly - if this command is bedrock only
      Returns:
      the builder
    • executor

      Command.Builder<T> executor(@NonNull CommandExecutor<T> executor)
      Sets the CommandExecutor for this command.
      Parameters:
      executor - the command executor
      Returns:
      the builder
    • build

      @NonNull Command build()
      Builds the command.
      Returns:
      the command