public abstract class Command extends Object
CommandSender
.Constructor and Description |
---|
Command(String name)
Construct a new command with no permissions or aliases.
|
Command(String name,
String permission,
String... aliases)
Construct a new command.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
execute(CommandSender sender,
String[] args)
Execute this command with the specified sender and arguments.
|
boolean |
hasPermission(CommandSender sender)
Check if this command can be executed by the given sender.
|
public Command(String name)
name
- the name of this commandpublic Command(String name, String permission, String... aliases)
name
- primary name of this commandpermission
- the permission node required to execute this command,
null or empty string allows it to be executed by everyonealiases
- aliases which map back to this commandpublic abstract void execute(CommandSender sender, String[] args)
sender
- the executor of this commandargs
- arguments used to invoke this commandpublic boolean hasPermission(CommandSender sender)
sender
- the sender to checkCopyright © 2012–2019 SpigotMC. All rights reserved.