Class CommandSyntax
java.lang.Object
net.minestom.server.command.builder.CommandSyntax
Represents a syntax in
Command
which is initialized with Command.addSyntax(CommandExecutor, Argument[]).-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedCommandSyntax(@Nullable CommandCondition commandCondition, CommandExecutor commandExecutor, @Nullable Map<String, Function<CommandSender, Object>> defaultValuesMap, Argument<?>... args) protectedCommandSyntax(@Nullable CommandCondition commandCondition, CommandExecutor commandExecutor, Argument<?>... args) -
Method Summary
Modifier and TypeMethodDescriptionArgument<?>[]Gets all the requiredArgumentfor this syntax.Gets the condition to use this syntax.Gets theCommandExecutorof this syntax, executed once the syntax is properly written.booleanvoidsetCommandCondition(@Nullable CommandCondition commandCondition) Changes the command condition of this syntax.voidsetExecutor(CommandExecutor executor) Changes theCommandExecutorof this syntax.
-
Constructor Details
-
CommandSyntax
protected CommandSyntax(@Nullable @Nullable CommandCondition commandCondition, CommandExecutor commandExecutor, @Nullable @Nullable Map<String, Function<CommandSender, Object>> defaultValuesMap, Argument<?>... args) -
CommandSyntax
protected CommandSyntax(@Nullable @Nullable CommandCondition commandCondition, CommandExecutor commandExecutor, Argument<?>... args)
-
-
Method Details
-
getCommandCondition
Gets the condition to use this syntax.- Returns:
- this command condition, null if none
-
setCommandCondition
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
Gets theCommandExecutorof this syntax, executed once the syntax is properly written.- Returns:
- the executor of this syntax
-
setExecutor
Changes theCommandExecutorof this syntax.- Parameters:
executor- the new executor
-
getDefaultValuesMap
-
getArguments
-
hasSuggestion
public boolean hasSuggestion() -
getSyntaxString
-