PocketMine-MP 5.21.2 git-a6534ecbbbcf369264567d27e5ed70f7f5be9816
|
Public Member Functions | |
__construct (protected CommandSender $sender, protected string $command) | |
call () | |
getCommand () | |
getEventName () | |
getSender () | |
isCancelled () | |
setCommand (string $command) | |
Static Public Member Functions | |
static | hasHandlers () |
Protected Attributes | |
string | $eventName = null |
Called when any CommandSender runs a command, before it is parsed.
This can be used for logging commands, or preprocessing the command string to add custom features (e.g. selectors).
WARNING: DO NOT use this to block commands. Many commands have aliases. For example, /version can also be invoked using /ver or /about. To prevent command senders from using certain commands, deny them permission to use the commands you don't want them to have access to.
The message DOES NOT begin with a slash.
Definition at line 44 of file CommandEvent.php.
pocketmine\event\server\CommandEvent::__construct | ( | protected CommandSender | $sender, |
protected string | $command ) |
Definition at line 47 of file CommandEvent.php.
|
inherited |
pocketmine\event\server\CommandEvent::getCommand | ( | ) |
Definition at line 56 of file CommandEvent.php.
pocketmine\event\server\CommandEvent::getSender | ( | ) |
Definition at line 52 of file CommandEvent.php.
|
staticinherited |
|
inherited |
Returns whether this instance of the event is currently cancelled.
If it is cancelled, only downstream handlers that declare @handleCancelled
will be called with this event.
pocketmine\event\server\CommandEvent::setCommand | ( | string | $command | ) |
Definition at line 60 of file CommandEvent.php.
|
protectedinherited |