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
ModifierConstructorDescriptionprotected
CommandSyntax
(@Nullable CommandCondition commandCondition, @NotNull CommandExecutor commandExecutor, @Nullable Map<String, Function<CommandSender, Object>> defaultValuesMap, @NotNull Argument<?>... args) protected
CommandSyntax
(@Nullable CommandCondition commandCondition, @NotNull CommandExecutor commandExecutor, @NotNull Argument<?>... args) -
Method Summary
Modifier and TypeMethodDescription@NotNull Argument<?>[]
Gets all the requiredArgument
for this syntax.@Nullable CommandCondition
Gets the condition to use this syntax.protected @Nullable Map
<String, Function<CommandSender, Object>> @NotNull CommandExecutor
Gets theCommandExecutor
of this syntax, executed once the syntax is properly written.@NotNull String
boolean
void
setCommandCondition
(@Nullable CommandCondition commandCondition) Changes the command condition of this syntax.void
setExecutor
(@NotNull CommandExecutor executor) Changes theCommandExecutor
of 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 theCommandExecutor
of this syntax, executed once the syntax is properly written.- Returns:
- the executor of this syntax
-
setExecutor
Changes theCommandExecutor
of this syntax.- Parameters:
executor
- the new executor
-
getDefaultValuesMap
-
getArguments
Gets all the requiredArgument
for this syntax.- Returns:
- the required arguments
-
hasSuggestion
public boolean hasSuggestion() -
getSyntaxString
-