PluginIdentifiableCommandpublic final class PluginCommand extends Command implements PluginIdentifiableCommand
Command belonging to a plugindescription, timings, usageMessage| Modifier | Constructor | Description |
|---|---|---|
protected |
PluginCommand(java.lang.String name,
Plugin owner) |
| Modifier and Type | Method | Description |
|---|---|---|
boolean |
execute(CommandSender sender,
java.lang.String commandLabel,
java.lang.String[] args) |
Executes the command, returning its success
|
CommandExecutor |
getExecutor() |
Gets the
CommandExecutor associated with this command |
Plugin |
getPlugin() |
Gets the owner of this PluginCommand
|
TabCompleter |
getTabCompleter() |
Gets the
TabCompleter associated with this command. |
void |
setExecutor(CommandExecutor executor) |
Sets the
CommandExecutor to run when parsing this command |
void |
setTabCompleter(TabCompleter completer) |
Sets the
TabCompleter to run when tab-completing this command. |
java.util.List<java.lang.String> |
tabComplete(CommandSender sender,
java.lang.String alias,
java.lang.String[] args) |
Executed on tab completion for this command, returning a list of
options the player can tab through.
|
java.lang.String |
toString() |
broadcastCommandMessage, broadcastCommandMessage, getAliases, getDescription, getLabel, getName, getPermission, getPermissionMessage, getUsage, isRegistered, register, setAliases, setDescription, setLabel, setName, setPermission, setPermissionMessage, setUsage, tabComplete, testPermission, testPermissionSilent, unregisterprotected PluginCommand(java.lang.String name,
Plugin owner)
public boolean execute(CommandSender sender, java.lang.String commandLabel, java.lang.String[] args)
public void setExecutor(CommandExecutor executor)
CommandExecutor to run when parsing this commandexecutor - New executor to runpublic CommandExecutor getExecutor()
CommandExecutor associated with this commandpublic void setTabCompleter(TabCompleter completer)
TabCompleter to run when tab-completing this command.
If no TabCompleter is specified, and the command's executor implements TabCompleter, then the executor will be used for tab completion.
completer - New tab completerpublic TabCompleter getTabCompleter()
TabCompleter associated with this command.public Plugin getPlugin()
getPlugin in interface PluginIdentifiableCommandpublic java.util.List<java.lang.String> tabComplete(CommandSender sender, java.lang.String alias, java.lang.String[] args) throws CommandException, java.lang.IllegalArgumentException
Delegates to the tab completer if present.
If it is not present or returns null, will delegate to the current
command executor if it implements TabCompleter. If a non-null
list has not been found, will default to standard player name
completion in Command.tabComplete(CommandSender, String, String[]).
This method does not consider permissions.
tabComplete in class Commandsender - Source object which is executing this commandalias - the alias being usedargs - All arguments passed to the command, split via ' 'CommandException - if the completer or executor throw an
exception during the process of tab-completing.java.lang.IllegalArgumentException - if sender, alias, or args is nullCopyright © 2018. All rights reserved.