Overview

Namespaces

  • aliuly
    • common
      • selectors
    • loader
  • xPaw

Classes

  • ArmorItems
  • BasicCli
  • BasicHelp
  • BasicPlugin
  • ChatSession
  • Cmd
  • CmdSelector
  • ExpandVars
  • FastTransfer
  • FileUtils
  • FreezeSession
  • GetMotd
  • GetMotdAsyncTask
  • InvisibleSession
  • InvUtils
  • ItemName
  • mc
  • mc2
  • MoneyAPI
  • MPMU
  • Npc
  • PermUtils
  • PluginAsyncTask
  • PluginCallbackTask
  • PMScript
  • QueryAsyncTask
  • Rcon
  • RconTask
  • Session
  • ShieldSession
  • ShoppingCart
  • SignUtils
  • SkinUtils
  • SpySession
  • SubCommandMap
  • TPUtils
  • Overview
  • Namespace
  • Class

Class Cmd

Utility class to execute commands|chat's as player or console

Abstract
Namespace: aliuly\common
Located at aliuly/common/Cmd.php
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
  • Entity to impersonate
$cmd
  • commands to execute
$show
  • show commands being executed
public static str
# system( Server $server, str $cmd )

Execute a command capturing output

Execute a command capturing output

Parameters

$server
$cmd
  • command to execute

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
  • Entity to impersonate
$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
  • commands to execute
$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

$ctx
  • running context
$cmdline
  • command line to execute
public static
# addCommand( Plugin $plugin, CommandExecutor $executor, str $cmd, array $yaml )

Register a command

Register a command

Parameters

$plugin
  • plugin that "owns" the command
$executor
  • object that will be called onCommand
$cmd
  • Command name
$yaml
  • Additional settings for this command.
public static
# rmCommand( Server|Plugin $srv, str $cmd )

Unregisters a command

Unregisters a command

Parameters

$srv
$obj - Access path to server instance
$cmd
  • Command name to remove
API documentation generated by ApiGen