Skip to content
mc-protocol
Esc
↑↓navigate↵open⌘Jpreview
On this page

Player Chat

Play 0x41, server → client.

play · 0x41 · clientbound (server → client)

Delivers a signed chat message from the player senderUuid, with the plainMessage, its signature, timestamp, salt, and references to previous messages for the signature chain. It also carries the chat type and display names, and an optional filtered or unsigned variant. The client verifies the signature and displays the message with the chat type’s formatting.

Sent by the server, read by the client. Listen for it with client.on("PlayerChat", (data) => …) on the receiving side.

Fields

Field Type Notes
globalIndex VarInt
senderUuid UUID
index VarInt
signature Optional
plainMessage String
timestamp Long
salt Long
previousMessages previousMessages
unsignedChatContent Optional
filterType VarInt
filterTypeMask Struct
type ChatTypesHolder also subscriptionType
networkName NBT
networkTargetName Optional

Send it

await client.sendPacket("PlayerChat", {
  globalIndex: /* VarInt */,
  senderUuid: /* UUID */,
  index: /* VarInt */,
  signature: /* Optional */,
  plainMessage: /* String */,
  timestamp: /* Long */,
  salt: /* Long */,
  previousMessages: /* previousMessages */,
  unsignedChatContent: /* Optional */,
  filterType: /* VarInt */,
  filterTypeMask: /* Struct */,
  type: /* ChatTypesHolder */,
  networkName: /* NBT */,
  networkTargetName: /* Optional */,
});

Field aliases listed under Notes are accepted as alternative keys when writing.

Source: src/Core/Versions/776/Packets/play/clientbound/PlayerChat.ts

Was this page helpful?