Class Cmd
Utility class to execute commands|chat's as player or console
Methods summary
public static
|
#
exec( pocketmine\Player|pocketmine\command\CommandSender $sender, str[]|str $cmd, boolean $show = true )
Execute a command as a given player
Execute a command as a given player
Parameters
- $sender
- $cmd
- $show
- show commands being executed
|
public static
str
|
#
system( Server $server, str $cmd )
Execute a command capturing output
Execute a command capturing output
Parameters
Returns
str
|
public static
|
#
chat( pocketmine\Player|pocketmine\command\CommandSender $sender, str[]|str $msgs )
Chat a message as a given player
Chat a message as a given player
Parameters
- $sender
- $msgs
- $msg - messages to send
|
public static
|
#
console( Server $server, str[]|str $cmd, boolean $show = false )
Execute commands as console
Execute commands as console
Parameters
- $server
- pocketmine\Server instance
- $cmd
- $show
- show commands being executed
|
public static
|
#
opexec( pocketmine\command\CommandSender $ctx, str $cmdline )
Handles command prefixes before dispatching commands.
Handles command prefixes before dispatching commands.
The following prefixes are recognized:
- "+op:", temporarily gives the player Op (if the player is not Op yet)
- "+console:", runs the command as if it was run from the console.
- "+rcon:", runs the command as if it was run from a RemoteConsole, capturing all output which is then send to the player.
Parameters
|
public static
|
#
addCommand( Plugin $plugin, CommandExecutor $executor, str $cmd, array $yaml )
Register a command
Parameters
- $plugin
- plugin that "owns" the command
- $executor
- object that will be called onCommand
- $cmd
- $yaml
- Additional settings for this command.
|
public static
|
#
rmCommand( Server|Plugin $srv, str $cmd )
Unregisters a command
Parameters
- $srv
- $obj - Access path to server instance
- $cmd
|