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, @NotNull CommandExecutor commandExecutor, @Nullable Map<String, Function<CommandSender, Object>> defaultValuesMap, @NotNull Argument<?>... args) protectedCommandSyntax(@Nullable CommandCondition commandCondition, @NotNull CommandExecutor commandExecutor, @NotNull Argument<?>... args) -
Method Summary
Modifier and TypeMethodDescription@NotNull Argument<?>[]Gets all the requiredArgumentfor this syntax.@Nullable CommandConditionGets the condition to use this syntax.protected @Nullable Map<String, Function<CommandSender, Object>> @NotNull CommandExecutorGets theCommandExecutorof this syntax, executed once the syntax is properly written.@NotNull StringbooleanvoidsetCommandCondition(@Nullable CommandCondition commandCondition) Changes the command condition of this syntax.voidsetExecutor(@NotNull CommandExecutor executor) Changes theCommandExecutorof this syntax.
-
Constructor Details
-
CommandSyntax
protected CommandSyntax(@Nullable @Nullable CommandCondition commandCondition, @NotNull @NotNull CommandExecutor commandExecutor, @Nullable @Nullable Map<String, Function<CommandSender, Object>> defaultValuesMap, @NotNull @NotNull Argument<?>... args) -
CommandSyntax
protected CommandSyntax(@Nullable @Nullable CommandCondition commandCondition, @NotNull @NotNull CommandExecutor commandExecutor, @NotNull @NotNull 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
Gets all the requiredArgumentfor this syntax.- Returns:
- the required arguments
-
hasSuggestion
public boolean hasSuggestion() -
getSyntaxString
-