Difference between revisions of "Chat"
(Ask dav1d if you have a question about this edit) |
m (→Client chat mode: Typo.) |
||
(87 intermediate revisions by 20 users not shown) | |||
Line 1: | Line 1: | ||
− | + | {{Hatnote|This page previously contained documentation on text formatting features, which can now be found at [[Text formatting]].}} | |
− | + | This article details various aspects of Minecraft's chat system. The packets themselves are documented in [[Protocol]]. | |
− | + | == Client chat mode == | |
− | The | + | The client may use the Chat Mode field of the [[Protocol#Client Information (configuration)|Client Information]] packet to indicate that it only wants to receive some types of chat messages. |
− | |||
− | |||
− | |||
− | |||
− | |||
− | + | It is the server's responsibility to not send packets if the client has the given type disabled. However, it is the client's responsibility to not send incorrect chat packets. | |
− | + | Here's a matrix comparing what packets the server should send to clients based on their chat settings: | |
− | + | {| class="wikitable" | |
+ | !rowspan="2" | Clientbound packet | ||
+ | !colspan="3" | Client setting | ||
+ | !rowspan="2" | Usage | ||
+ | |- | ||
+ | ! Full | ||
+ | ! Commands only | ||
+ | ! Hidden | ||
+ | |- | ||
+ | | [[Protocol#Player Chat Message|Player Chat Message]] | ||
+ | | {{yes|✔}} | ||
+ | | {{no|✘}} | ||
+ | | {{no|✘}} | ||
+ | | Player-initiated chat messages, including the commands <code>/say</code>, <code>/me</code>, <code>/msg</code>, <code>/tell</code>, <code>/w</code> and <code>/teammsg</code>. | ||
+ | |- | ||
+ | | [[Protocol#Disguised Chat Message|Disguised Chat Message]] | ||
+ | | {{yes|✔}} | ||
+ | | {{no|✘}} | ||
+ | | {{no|✘}} | ||
+ | | Messages sent by non-players using the commands <code>/say</code>, <code>/me</code>, <code>/msg</code>, <code>/tell</code>, <code>/w</code> and <code>/teammsg</code>. | ||
+ | |- | ||
+ | | [[Protocol#System Chat Message|System Chat Message]] | ||
+ | | {{yes|✔}} | ||
+ | | {{yes|✔}} | ||
+ | | {{no|✘}} | ||
+ | | Feedback from running a command, such as "Your game mode has been updated to creative." | ||
+ | |- | ||
+ | | [[Protocol#System Chat Message|System Chat Message]] (overlay) | ||
+ | | {{yes|✔}} | ||
+ | | {{yes|✔}} | ||
+ | | {{yes|✔}} | ||
+ | | Game state information that is displayed above the hot bar, such as "You may not rest now, the bed is too far away". | ||
+ | |} | ||
− | + | Here's a matrix comparing what the client may send based on its chat setting: | |
− | == | + | {| class="wikitable" |
+ | !rowspan="2" | Serverbound packet | ||
+ | !colspan="3" | Client setting | ||
+ | |- | ||
+ | ! Full | ||
+ | ! Commands only | ||
+ | ! Hidden | ||
+ | |- | ||
+ | | [[Protocol#Chat Message|Chat Message]] | ||
+ | | {{yes|✔}} | ||
+ | | {{maybe|✘<ref group="note">This behavior varies. The Notchian server <em>previously</em> rejected chat messages, but now allows them to go through (sending them to all players, but they're invisible on the sender's side). CraftBukkit and derivatives continue to reject this. See [https://bugs.mojang.com/browse/MC-116824 MC-116824] for more information.</ref>}} | ||
+ | | {{no|✘}} | ||
+ | |- | ||
+ | | [[Protocol#Chat Command|Chat Command]] | ||
+ | | {{yes|✔}} | ||
+ | | {{yes|✔}} | ||
+ | | {{no|✘}} | ||
+ | |} | ||
− | + | If the client attempts to send a chat message and the server rejects it, the Notchian server will send that client a [[Protocol#System Chat Message|System Chat Message]] (non-overlay) with a red <code>chat.disabled.options</code> translation component (which becomes "Chat disabled in client options."). | |
− | + | == Social Interactions (blocking) == | |
− | |||
− | + | 1.16 added a ''social interactions screen'' that lets players block chat from other players. Blocking takes place clientside by detecting whether a message is from a blocked player. | |
− | + | [[Protocol#Player Chat Message|Player Chat Message]] packets are blocked based on the included sender UUID. | |
− | + | [[Protocol#Disguised Chat Message|Disguised Chat Message]] packets are never blocked. | |
− | + | [[Protocol#System Chat Message|System Chat Message]] packets (regardless of the Overlay field!) are blocked based on the first occurrence of <code><''playername''></code> anywhere in the message, including split across multiple text components, where ''playername'' may be any text, including the empty string or whitespace. If ''playername'' is the name of a blocked player (matched case-sensitively), the message is blocked. This only occurs if Hide Matched Names is enabled in Chat Settings (the default). | |
− | + | == Notes == | |
− | + | <references group="note" /> | |
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
[[Category:Protocol Details]] | [[Category:Protocol Details]] | ||
[[Category:Minecraft Modern]] | [[Category:Minecraft Modern]] |
Latest revision as of 23:22, 13 March 2024
- This page previously contained documentation on text formatting features, which can now be found at Text formatting.
This article details various aspects of Minecraft's chat system. The packets themselves are documented in Protocol.
Client chat mode
The client may use the Chat Mode field of the Client Information packet to indicate that it only wants to receive some types of chat messages.
It is the server's responsibility to not send packets if the client has the given type disabled. However, it is the client's responsibility to not send incorrect chat packets.
Here's a matrix comparing what packets the server should send to clients based on their chat settings:
Clientbound packet | Client setting | Usage | ||
---|---|---|---|---|
Full | Commands only | Hidden | ||
Player Chat Message | ✔ | ✘ | ✘ | Player-initiated chat messages, including the commands /say , /me , /msg , /tell , /w and /teammsg .
|
Disguised Chat Message | ✔ | ✘ | ✘ | Messages sent by non-players using the commands /say , /me , /msg , /tell , /w and /teammsg .
|
System Chat Message | ✔ | ✔ | ✘ | Feedback from running a command, such as "Your game mode has been updated to creative." |
System Chat Message (overlay) | ✔ | ✔ | ✔ | Game state information that is displayed above the hot bar, such as "You may not rest now, the bed is too far away". |
Here's a matrix comparing what the client may send based on its chat setting:
Serverbound packet | Client setting | ||
---|---|---|---|
Full | Commands only | Hidden | |
Chat Message | ✔ | ✘[note 1] | ✘ |
Chat Command | ✔ | ✔ | ✘ |
If the client attempts to send a chat message and the server rejects it, the Notchian server will send that client a System Chat Message (non-overlay) with a red chat.disabled.options
translation component (which becomes "Chat disabled in client options.").
Social Interactions (blocking)
1.16 added a social interactions screen that lets players block chat from other players. Blocking takes place clientside by detecting whether a message is from a blocked player.
Player Chat Message packets are blocked based on the included sender UUID.
Disguised Chat Message packets are never blocked.
System Chat Message packets (regardless of the Overlay field!) are blocked based on the first occurrence of <playername>
anywhere in the message, including split across multiple text components, where playername may be any text, including the empty string or whitespace. If playername is the name of a blocked player (matched case-sensitively), the message is blocked. This only occurs if Hide Matched Names is enabled in Chat Settings (the default).