Proposal for the Chat Message packet. Includes clientbound (S->C) and serverbound (C->S) versions.
The packet is used for sending messages in chat and displaying messages on the client, like in v0.75.
Notice that the message Content is encoded as UTF-8, not CP437. UTF-8 is easier to work with and it supports more characters.
Chat Message
(The ID can be changed, I just picked the one that is in v0.75)
Clientbound
| Info |
Size |
| Total Size: |
1 or 2 + Length of Content |
| Field Name |
Field Type |
Example |
Notes |
| Message type |
UByte |
0 |
See table below |
| (Sender) |
UByte |
0 |
The ID of the player who sent the message. Not included if type is not CHAT_ALL or CHAT_TEAM |
| Content |
String (UTF-8) |
Hello, client! |
|
Serverbound
| Info |
Size |
| Total Size: |
1 + Length of Content |
| Field Name |
Field Type |
Example |
Notes |
| Message type |
UByte |
0 |
Only CHAT_ALL and CHAT_TEAM message types are allowed to be sent by client. See table below |
| Content |
String (UTF-8) |
Hello, server! |
|
Message types supported by the protocol (see here for explanation):
| Value |
Type |
| 0 |
CHAT_ALL |
| 1 |
CHAT_TEAM |
| 2 |
CHAT_SYSTEM |
| 3 |
CHAT_BIG |
| 4 |
CHAT_INFO |
| 5 |
CHAT_WARNING |
| 6 |
CHAT_ERROR |
Proposal for the Chat Message packet. Includes clientbound (S->C) and serverbound (C->S) versions.
The packet is used for sending messages in chat and displaying messages on the client, like in v0.75.
Notice that the message Content is encoded as UTF-8, not CP437. UTF-8 is easier to work with and it supports more characters.
Chat Message
(The ID can be changed, I just picked the one that is in v0.75)
Clientbound
00CHAT_ALLorCHAT_TEAMHello, client!Serverbound
0CHAT_ALLandCHAT_TEAMmessage types are allowed to be sent by client. See table belowHello, server!Message types supported by the protocol (see here for explanation):