Package dev.polv.taleapi.command
Class Command.Builder
java.lang.Object
dev.polv.taleapi.command.Command.Builder
- Enclosing class:
- Command
Builder for constructing
Command instances.-
Method Summary
Modifier and TypeMethodDescriptionAdds aliases for this command.build()Builds the command.description(String description) Sets a description for this command.executes(CommandExecutor executor) Sets the executor for the root node.permission(String permission) Sets the permission required to use this command.requires(Predicate<CommandSender> requirement) Sets a custom requirement predicate for this command.then(CommandNode<?> child) Adds a child node to the root of this command.
-
Method Details
-
description
Sets a description for this command.- Parameters:
description- the description- Returns:
- this builder
-
aliases
Adds aliases for this command.- Parameters:
aliases- the aliases- Returns:
- this builder
-
permission
Sets the permission required to use this command.- Parameters:
permission- the permission- Returns:
- this builder
-
requires
Sets a custom requirement predicate for this command.- Parameters:
requirement- the requirement- Returns:
- this builder
-
then
Adds a child node to the root of this command.- Parameters:
child- the child node- Returns:
- this builder
-
executes
Sets the executor for the root node.- Parameters:
executor- the executor- Returns:
- this builder
-
build
Builds the command.- Returns:
- the constructed command
-