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 |
---|---|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
abstract void |
execute(CommandSender sender,
String[] args)
Execute this command with the specified sender and arguments.
|
String[] |
getAliases() |
String |
getName() |
String |
getPermission() |
int |
hashCode() |
boolean |
hasPermission(CommandSender sender)
Check if this command can be executed by the given sender.
|
String |
toString() |
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 checkpublic String getName()
public String getPermission()
public String[] getAliases()
protected boolean canEqual(Object other)
Copyright © 2012–2020 SpigotMC. All rights reserved.