Class SimpleCommand
java.lang.Object
net.minestom.server.command.builder.Command
net.minestom.server.command.builder.SimpleCommand
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract boolean
hasAccess
(@NotNull CommandSender sender, @Nullable String commandString) Called to know if a player has access to the command.abstract boolean
process
(@NotNull CommandSender sender, @NotNull String command, @NotNull String[] args) Called when the command is executed by aCommandSender
.Methods inherited from class net.minestom.server.command.builder.Command
addConditionalSyntax, addSubcommand, addSyntax, addSyntax, getAliases, getCondition, getDefaultExecutor, getName, getNames, getSubcommands, getSyntaxes, getSyntaxesStrings, getSyntaxesTree, globalListener, isValidName, setArgumentCallback, setCondition, setDefaultExecutor
-
Constructor Details
-
SimpleCommand
-
-
Method Details
-
process
public abstract boolean process(@NotNull @NotNull CommandSender sender, @NotNull @NotNull String command, @NotNull @NotNull String[] args) Called when the command is executed by aCommandSender
.- Parameters:
sender
- the sender which executed the commandcommand
- the command name usedargs
- an array containing all the args (split by space char)- Returns:
- true when the command is successful, false otherwise
-
hasAccess
public abstract boolean hasAccess(@NotNull @NotNull CommandSender sender, @Nullable @Nullable String commandString) Called to know if a player has access to the command.- Parameters:
sender
- the command sender to check the accesscommandString
- the raw command string, null if this is an access request- Returns:
- true if the player has access to the command, false otherwise
-