Package net.md_5.bungee.api.plugin
Class Command
java.lang.Object
net.md_5.bungee.api.plugin.Command
- Direct Known Subclasses:
PlayerCommand
A command that can be executed by a
CommandSender
.-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected boolean
boolean
void
execute
(CommandSender sender, String[] args) Deprecated.new execute method, including alias.void
execute
(CommandSender sender, String alias, String[] args) Execute this command with the specified sender, alias and arguments.String[]
getName()
int
hashCode()
boolean
hasPermission
(CommandSender sender) Check if this command can be executed by the given sender.protected void
setPermissionMessage
(String permissionMessage) protected void
setPermissionMessageComponent
(BaseComponent[] permissionMessageComponent) toString()
-
Constructor Details
-
Command
Construct a new command with no permissions or aliases.- Parameters:
name
- the name of this command
-
Command
Construct a new command.- Parameters:
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 command
-
-
Method Details
-
execute
Deprecated.new execute method, including alias. Migrate toexecute(CommandSender, String, String[])
Execute this command with the specified sender and arguments.- Parameters:
sender
- the executor of this commandargs
- arguments used to invoke this command
-
execute
Execute this command with the specified sender, alias and arguments.- Parameters:
sender
- the executor of this commandalias
- the alias of which the command was invokedargs
- arguments used to invoke this command
-
hasPermission
Check if this command can be executed by the given sender.- Parameters:
sender
- the sender to check- Returns:
- whether the sender can execute this
-
setPermissionMessage
-
setPermissionMessageComponent
-
getName
-
getPermission
-
getAliases
-
getPermissionMessage
-
getPermissionMessageComponent
-
equals
-
canEqual
-
hashCode
public int hashCode() -
toString
-