# PlayerChatEvent

PlayerChatEvent is a **cancellabe** event fired when a player sends a chat message.

If the sent message is a chat command (a message sent to the server account), this event is fired prior to [PlayerSendCommandEvent](https://irminsul.gitbook.io/irminsul/api/api-references/game-events/playersendcommandevent), which is in turn fired prior to [PlayerExecuteCommandEvent](https://irminsul.gitbook.io/irminsul/api/api-references/game-events/playerexecutecommandevent).

## Fields

### cancelled

*boolean, inherited*

Whether this event has been cancelled

### sender

final *`io.irminsul.common.game.player.Player`*

The player sending the message. Guaranteed non-null.

### recipient

final int

The UID of the message recipient

### text

String

The text of the message. This will be empty if the player sent an emote instead. Guaranteed non-null.

### emote

int

The emote attached with the message. This will be zero if a text message was sent instead.&#x20;
