CommandEvent
Extends ServerEvent
Implements Cancellable
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.
Properties
$command
php
public string $command$sender
php
public \pocketmine\command\CommandSender $senderMethods
__construct()
php
public function __construct(\pocketmine\command\CommandSender $sender, string $command)getCommand()
php
public function getCommand() : stringgetSender()
php
public function getSender() : \pocketmine\command\CommandSendersetCommand()
php
public function setCommand(string $command) : void