> For the complete documentation index, see [llms.txt](https://irminsul.gitbook.io/irminsul/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://irminsul.gitbook.io/irminsul/api/api-references/game-events/playerchatevent.md).

# PlayerChatEvent

Documentation for the PlayerChatEvent event in the Irminsul game server API

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](/irminsul/api/api-references/game-events/playersendcommandevent.md), which is in turn fired prior to [PlayerExecuteCommandEvent](/irminsul/api/api-references/game-events/playerexecutecommandevent.md).

## 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;
