Class CommandSyntax

java.lang.Object
net.minestom.server.command.builder.CommandSyntax

public class CommandSyntax extends Object
Represents a syntax in Command which is initialized with Command.addSyntax(CommandExecutor, Argument[]).
  • Constructor Details

  • Method Details

    • getCommandCondition

      @Nullable public @Nullable CommandCondition getCommandCondition()
      Gets the condition to use this syntax.
      Returns:
      this command condition, null if none
    • setCommandCondition

      public void setCommandCondition(@Nullable @Nullable CommandCondition commandCondition)
      Changes the command condition of this syntax.

      Be aware that changing the command condition will not automatically update players auto-completion. You can create a new packet containing the changes with CommandManager.createDeclareCommandsPacket(Player).

      Parameters:
      commandCondition - the new command condition, null to remove it
    • getExecutor

      @NotNull public @NotNull CommandExecutor getExecutor()
      Gets the CommandExecutor of this syntax, executed once the syntax is properly written.
      Returns:
      the executor of this syntax
    • setExecutor

      public void setExecutor(@NotNull @NotNull CommandExecutor executor)
      Changes the CommandExecutor of this syntax.
      Parameters:
      executor - the new executor
    • getDefaultValuesMap

      @Nullable protected @Nullable Map<String,Function<CommandSender,Object>> getDefaultValuesMap()
    • getArguments

      @NotNull public @NotNull Argument<?>[] getArguments()
      Gets all the required Argument for this syntax.
      Returns:
      the required arguments
    • hasSuggestion

      public boolean hasSuggestion()
    • getSyntaxString

      @NotNull public @NotNull String getSyntaxString()