Bukkit-API  1.7.9-R0.2
The inofficial Bukkit-API
org.bukkit.command.CommandMap Interface Reference
Inheritance diagram for org.bukkit.command.CommandMap:
org.bukkit.command.SimpleCommandMap

Public Member Functions

void registerAll (String fallbackPrefix, List< Command > commands)
 
boolean register (String label, String fallbackPrefix, Command command)
 
boolean register (String fallbackPrefix, Command command)
 
boolean dispatch (CommandSender sender, String cmdLine) throws CommandException
 
void clearCommands ()
 
Command getCommand (String name)
 
List< String > tabComplete (CommandSender sender, String cmdLine) throws IllegalArgumentException
 

Detailed Description

Definition at line 5 of file CommandMap.java.

Member Function Documentation

void org.bukkit.command.CommandMap.clearCommands ( )

Clears all registered commands.

Implemented in org.bukkit.command.SimpleCommandMap.

boolean org.bukkit.command.CommandMap.dispatch ( CommandSender  sender,
String  cmdLine 
) throws CommandException

Looks for the requested command and executes it if found.

Parameters
senderThe command's sender
cmdLinecommand + arguments. Example: "/test abc 123"
Returns
returns false if no target is found, true otherwise.
Exceptions
CommandExceptionThrown when the executor for the given command fails with an unhandled exception

Implemented in org.bukkit.command.SimpleCommandMap.

Command org.bukkit.command.CommandMap.getCommand ( String  name)

Gets the command registered to the specified name

Parameters
nameName of the command to retrieve
Returns
Command with the specified name or null if a command with that label doesn't exist

Implemented in org.bukkit.command.SimpleCommandMap.

boolean org.bukkit.command.CommandMap.register ( String  label,
String  fallbackPrefix,
Command  command 
)

Registers a command. Returns true on success; false if name is already taken and fallback had to be used.

Caller can use:-

  • command.getName() to determine the label registered for this command
  • command.getAliases() to determine the aliases which where registered
Parameters
labelthe label of the command, without the '/'-prefix.
fallbackPrefixa prefix which is prepended to the command with a ':' one or more times to make the command unique
commandthe command to register
Returns
true if command was registered with the passed in label, false otherwise, which indicates the fallbackPrefix was used one or more times

Implemented in org.bukkit.command.SimpleCommandMap.

boolean org.bukkit.command.CommandMap.register ( String  fallbackPrefix,
Command  command 
)

Registers a command. Returns true on success; false if name is already taken and fallback had to be used.

Caller can use:-

  • command.getName() to determine the label registered for this command
  • command.getAliases() to determine the aliases which where registered
Parameters
fallbackPrefixa prefix which is prepended to the command with a ':' one or more times to make the command unique
commandthe command to register, from which label is determined from the command name
Returns
true if command was registered with the passed in label, false otherwise, which indicates the fallbackPrefix was used one or more times

Implemented in org.bukkit.command.SimpleCommandMap.

void org.bukkit.command.CommandMap.registerAll ( String  fallbackPrefix,
List< Command commands 
)

Registers all the commands belonging to a certain plugin.

Caller can use:-

  • command.getName() to determine the label registered for this command
  • command.getAliases() to determine the aliases which where registered
Parameters
fallbackPrefixa prefix which is prepended to each command with a ':' one or more times to make the command unique
commandsa list of commands to register

Implemented in org.bukkit.command.SimpleCommandMap.

List<String> org.bukkit.command.CommandMap.tabComplete ( CommandSender  sender,
String  cmdLine 
) throws IllegalArgumentException

Looks for the requested command and executes an appropriate tab-completer if found. This method will also tab-complete partial commands.

Parameters
senderThe command's sender.
cmdLineThe entire command string to tab-complete, excluding initial slash.
Returns
a list of possible tab-completions. This list may be immutable. Will be null if no matching command of which sender has permission.
Exceptions
CommandExceptionThrown when the tab-completer for the given command fails with an unhandled exception
IllegalArgumentExceptionif either sender or cmdLine are null

Implemented in org.bukkit.command.SimpleCommandMap.


The documentation for this interface was generated from the following file: