CommandEvent
extends ServerEvent
in package
implements
Cancellable
Uses
CancellableTrait
Called when any CommandSender runs a command, early in the process
You don't want to use this except for a few cases like logging commands, blocking commands on certain places, or applying modifiers.
The message DOES NOT contain a slash at the start
Interfaces, Classes, Traits and Enums
- Cancellable
- This interface is implemented by an Event subclass if and only if it can be cancelled.
Table of Contents
- MAX_EVENT_CALL_DEPTH = 50
- $command : string
- $eventName : string|null
- $sender : CommandSender
- $eventCallDepth : int
- $isCancelled : bool
- __construct() : mixed
- call() : void
- Calls event handlers registered for this event.
- cancel() : void
- getCommand() : string
- getEventName() : string
- getSender() : CommandSender
- isCancelled() : bool
- setCommand() : void
- uncancel() : void
Constants
MAX_EVENT_CALL_DEPTH
private
mixed
MAX_EVENT_CALL_DEPTH
= 50
Properties
$command
protected
string
$command
$eventName
protected
string|null
$eventName
= null
$sender
protected
CommandSender
$sender
$eventCallDepth
private
static int
$eventCallDepth
= 1
$isCancelled
private
bool
$isCancelled
= false
Methods
__construct()
public
__construct(CommandSender $sender, string $command) : mixed
Parameters
- $sender : CommandSender
- $command : string
Return values
mixed —call()
Calls event handlers registered for this event.
public
call() : void
Tags
Return values
void —cancel()
public
cancel() : void
Return values
void —getCommand()
public
getCommand() : string
Return values
string —getEventName()
public
final getEventName() : string
Return values
string —getSender()
public
getSender() : CommandSender
Return values
CommandSender —isCancelled()
public
isCancelled() : bool
Return values
bool —setCommand()
public
setCommand(string $command) : void
Parameters
- $command : string
Return values
void —uncancel()
public
uncancel() : void