|
PocketMine-MP 5.36.1 git-eaa7c4834c8fe2f379d24e7f0ee6cc63cfb18ccc
|
Inheritance diagram for pocketmine\event\server\CommandEvent:
Collaboration diagram for pocketmine\event\server\CommandEvent: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 45 of file CommandEvent.php.
| pocketmine\event\server\CommandEvent::__construct | ( | protected CommandSender | $sender, |
| protected string | $command ) |
Definition at line 48 of file CommandEvent.php.
|
inherited |
| pocketmine\event\server\CommandEvent::getCommand | ( | ) |
Definition at line 57 of file CommandEvent.php.
| pocketmine\event\server\CommandEvent::getSender | ( | ) |
Definition at line 53 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 61 of file CommandEvent.php.
|
protectedinherited |