JSON formatting in the action bar is not supported via the chat packet, breaking coloration for some messages (spectators opening loot table chests and building too high)
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via
/setblock ~ ~ ~ minecraft:chest{"LootTable":"minecraft:chests/simple_dungeon"} - Switch to spectator mode
/gamemode spectator
- Attempt to open the chest
→ Note that the message that appears above the hotbar is white, not red
To directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
→ Observe that the message appears white
Cause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
- Cannot Reproduce
[Mod] Pokechu22- 18
- 11
- Confirmed
- (Unassigned)
- action-bar chat json packets title
1.12 - 1.15-pre6
1.12 17w31a 1.12.1-pre1 1.12.1 1.12.2-pre1 1.12.2-pre2 1.12.2 17w43a 17w43b 17w45a 17w46a 17w48a 17w50a 18w01a 18w03b 18w06a 18w09a 18w10d 18w14b 1.13-pre1 1.13-pre3 1.13-pre6 1.13-pre8 1.13-pre10 1.13 18w30b 18w31a 1.13.1 1.13.2 19w04b 19w05a 19w06a 19w11b 19w12a 19w13b 1.14-pre1 1.14 1.14.4 19w41a 1.15-pre6
Created Issue:
JSON formatting in the action bar is not supported via the chat packet, breaking coloration for some messages (spectators opening loot table chests and building too high)
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via /setblock ~ ~ ~ minecraft:chest 0 destroy {"LootTable":"minecraft:chests/simple_dungeon"}
- Switch to specator mode (/gamemode 3)
- Attempt to open the chest
- Note that the message that appears above the hotbar is white, not red
To directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
- Observe that the message appears white.
Cause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
is duplicated by
relates to
relates to
relates to
relates to
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via /setblock ~ ~ ~ minecraft:chest
0 destroy{"LootTable":"minecraft:chests/simple_dungeon"}
- Switch to specator mode (/gamemode 3)
- Attempt to open the chest
- Note that the message that appears above the hotbar is white, not red
To directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
- Observe that the message appears white.
Cause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via; {{/setblock ~ ~ ~ minecraft:chest {"LootTable":"minecraft:chests/simple_dungeon"}
}}
- Switch to specator mode (/gamemode 3)
- Attempt to open the chest
- Note that the message that appears above the hotbar is white, not red
To directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
- Observe that the message appears white.
Cause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via; {{/setblock ~ ~ ~ minecraft:chest {"LootTable":"minecraft:chests/simple_dungeon"}
}}
- Switch to specator mode
(/gamemode 3)- Attempt to open the chest
- Note that the message that appears above the hotbar is white, not red
To directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
- Observe that the message appears white.
Cause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
Chat messages in the action bar do not correctly render component-based formatting, if they are sent via the Chat packet (0x0F). However, they do work correctly if deprecated §-based formatting codes are sent within a component, or if the Title packet (0x47) is used.
Affected methods and actions
- Anything that directly sends a chat message with type GAME_INFO
- Anything that calls EntityPlayer.sendStatusMessage(IChatComponent, boolean) with the second parameter set to true (both serverside and clientside)
- Anything that calls GuiIngame.setOverlayMessage(IChatComponent, boolean) with the second parameter set to true.
Specifically, the following are known to have messages that are formatted, but don't display formatted:
- Opening a chest in spectator mode
- Building above the height limit
To reproduce in-game
- Create a chest with a loot table via
/setblock ~ ~ ~ minecraft:chest{"LootTable":"minecraft:chests/simple_dungeon"}- Switch to spectator mode
/gamemode spectator- Attempt to open the chest
→ Note that the message that appears above the hotbar is white, not redTo directly reproduce
- Send a chat packet (SPacketChat / 0x0F) with a payload such as {"color":"green","text":"Test"} and the position set to actionbar (ChatType.GAME_INFO / 2).
→ Observe that the message appears whiteCause
GuiIngame.setOverlayMessage(IChatComponent, boolean) uses component.getUnformattedText to get the text to display when it should use getFormattedText. (The method in question is on line 1107 of the actual source).
This does not affect the title packet because that method retrieves the formatted text and then uses GuiIngame.setOverlayMessage(String, boolean) with it.
Thank you for your report!
However, this issue is a Duplicate of MC-119145.
It has been linked to this report. If you have additional information, please add it to that report.
Please search before reporting, as it's likely that one exists already.
Quick Links:
📓 Issue Guidelines – 💬 Community Support – 📧 Customer Support – 📖 Game Wiki
Can confirm for 1.12 and 1.11.2 client.
How do you send that chat packet? I'm curious.
Also, confirmed in 1.12, when failed to place a command block on height level 256.
That requires a modified or otherwise custom server (which is the situation where this first was encountered – for the protocol documentation on wiki.vg); it's the situation where I first heard of this behavior, and then I went back and traced it to where a packet like that is sent in vanilla.
Confirmed for 19w11b
Confirmed for 19w12a.
Confirmed for 19w13b
Confirmed for 1.14 Pre-Release 1.
Confirmed for 1.14.
Confirmed for 19w41a.
Seems to be fixed in 1.16.2; could someone else please confirm this?
Tested colored text component with SPacketChat. Fixed in 1.16.2
Cannot reproduce on the current release.
I did some research when I had to figure out when this bug was fixed, and figured out that it was fixed in 20w17a for 1.16.0!
I assume that they just forgot to mention this as fixed as the same snapshot added font and hex color support to components and they likely just fixed the bug while adding that