PocketMine-MP 5.23.3 git-f7687af337d001ddbcc47b8e773f014a33faa662
Loading...
Searching...
No Matches
pocketmine\event\player\PlayerChatEvent Class Reference
+ Inheritance diagram for pocketmine\event\player\PlayerChatEvent:
+ Collaboration diagram for pocketmine\event\player\PlayerChatEvent:

Public Member Functions

 __construct (Player $player, protected string $message, protected array $recipients, protected ChatFormatter $formatter)
 
 call ()
 
 getEventName ()
 
 getFormatter ()
 
 getMessage ()
 
 getPlayer ()
 
 getRecipients ()
 
 isCancelled ()
 
 setFormatter (ChatFormatter $formatter)
 
 setMessage (string $message)
 
 setPlayer (Player $player)
 
 setRecipients (array $recipients)
 

Static Public Member Functions

static hasHandlers ()
 

Protected Attributes

string $eventName = null
 
Player $player
 

Detailed Description

Called when a player chats something

Definition at line 36 of file PlayerChatEvent.php.

Constructor & Destructor Documentation

◆ __construct()

pocketmine\event\player\PlayerChatEvent::__construct ( Player $player,
protected string $message,
protected array $recipients,
protected ChatFormatter $formatter )
Parameters
CommandSender[]$recipients

Definition at line 42 of file PlayerChatEvent.php.

Member Function Documentation

◆ call()

pocketmine\event\Event::call ( )
inherited

Calls event handlers registered for this event.

Exceptions

RuntimeException if event call recursion reaches the max depth limit

Definition at line 49 of file Event.php.

◆ getEventName()

pocketmine\event\Event::getEventName ( )
finalinherited

Definition at line 40 of file Event.php.

◆ getFormatter()

pocketmine\event\player\PlayerChatEvent::getFormatter ( )

Definition at line 66 of file PlayerChatEvent.php.

◆ getMessage()

pocketmine\event\player\PlayerChatEvent::getMessage ( )

Definition at line 51 of file PlayerChatEvent.php.

◆ getPlayer()

pocketmine\event\player\PlayerEvent::getPlayer ( )
inherited

Definition at line 35 of file PlayerEvent.php.

◆ getRecipients()

pocketmine\event\player\PlayerChatEvent::getRecipients ( )
Returns
CommandSender[]

Definition at line 77 of file PlayerChatEvent.php.

◆ hasHandlers()

static pocketmine\event\Event::hasHandlers ( )
staticinherited

Returns whether the current class context has any registered global handlers. This can be used in hot code paths to avoid unnecessary event object creation.

Usage: SomeEventClass::hasHandlers()

Definition at line 77 of file Event.php.

◆ isCancelled()

pocketmine\event\Cancellable::isCancelled ( )
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.

◆ setFormatter()

pocketmine\event\player\PlayerChatEvent::setFormatter ( ChatFormatter $formatter)

Definition at line 70 of file PlayerChatEvent.php.

◆ setMessage()

pocketmine\event\player\PlayerChatEvent::setMessage ( string $message)

Definition at line 55 of file PlayerChatEvent.php.

◆ setPlayer()

pocketmine\event\player\PlayerChatEvent::setPlayer ( Player $player)

Changes the player that is sending the message

Definition at line 62 of file PlayerChatEvent.php.

◆ setRecipients()

pocketmine\event\player\PlayerChatEvent::setRecipients ( array $recipients)
Parameters
CommandSender[]$recipients

Definition at line 84 of file PlayerChatEvent.php.

Member Data Documentation

◆ $eventName

string pocketmine\event\Event::$eventName = null
protectedinherited

Definition at line 38 of file Event.php.

◆ $player

Player pocketmine\event\player\PlayerEvent::$player
protectedinherited

Definition at line 33 of file PlayerEvent.php.


The documentation for this class was generated from the following file: