public interface Command
CommandSource
, such as a Player
or the console.Modifier and Type | Method and Description |
---|---|
void |
execute(CommandSource source,
String[] args)
Executes the command for the specified
CommandSource . |
default boolean |
hasPermission(CommandSource source,
String[] args)
Tests to check if the
source has permission to use this command with the provided
args . |
default List<String> |
suggest(CommandSource source,
String[] currentArgs)
Provides tab complete suggestions for a command for a specified
CommandSource . |
void execute(CommandSource source, String[] args)
CommandSource
.source
- the source of this commandargs
- the arguments for this commanddefault List<String> suggest(CommandSource source, String[] currentArgs)
CommandSource
.source
- the source to run the command forcurrentArgs
- the current, partial arguments for this commanddefault boolean hasPermission(CommandSource source, String[] args)
source
has permission to use this command with the provided
args
.
If this method returns false, the handling will be forwarded onto the players current server.
source
- the source of the commandargs
- the arguments for this command