Interface Command
public interface Command
Represents an executable command.
-
Method Summary
Modifier and TypeMethodDescriptionexecute(CommandSource source, String[] args) Execute this command.default StringGet the description of this command.getName()Get the primary name of this command.default StringGet the permission required to execute this command.default StringgetUsage()Get the usage string for this command.default booleanhasPermission(CommandSource source) Check if the source has permission to execute this command.suggest(CommandSource source, String[] args) Get tab completions for this command.
-
Method Details
-
getName
-
getPermission
Get the permission required to execute this command.- Returns:
- the permission, or null if no permission is required
-
getUsage
-
getDescription
-
execute
Execute this command.- Parameters:
source- the command sourceargs- the arguments passed to the command- Returns:
- the result of the command
-
suggest
Get tab completions for this command.- Parameters:
source- the command sourceargs- the current arguments- Returns:
- a list of possible completions
-
hasPermission
Check if the source has permission to execute this command.- Parameters:
source- the command source- Returns:
- true if the source can execute this command
-