Description of Bug
When the client receiving the packet clientbound/minecraft:system_chat
containing over 128 times nested NBT data from the server, the client is lost connection with the disconnect screen and the log message:
[20:15:44] [Render thread/WARN] (Minecraft) Client disconnected with reason: Internal Exception: io.netty.handler.codec.DecoderException: Failed to decode packet 'clientbound/minecraft:system_chat'
[media]This bug starts to affect since 24w09a.
Steps To Reproduce
Using Data Storage (Better Method)
Set up a server after 24w09a version or join the singleplayer world
Run the command using a Command Block or a Datapack function:
data modify storage mc-269171 data set value [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
Also run the command:
data get storage mc-269171 data
See the disconnection screen
Using HandItems
of Mob (TL; DR)
Configure a server after 24w09a version or join the singleplayer world. If you are creating a new singleplayer world, the recommended Superflat world preset is The Void.
Kill the all Husks already summoned
Summon the Husk that hold some item, like this:
summon husk ~ ~.5 ~ {NoAI:true,Silent:true,Tags:["test"],HandItems:[{id:"diamond",components:{custom_data:{test:{}}}}]}
Place a Repeating Command Block and a Lever, the command is
execute as @e[tag=test] run data modify entity @s HandItems[0].components.minecraft:custom_data.test.test set from entity @s HandItems[0].components.minecraft:custom_data.test
Freeze the game ticking using
tick freeze
commandActivate the Lever
Make to run the game during 128 ticks using
tick step 128
commandRun the command:
data get entity @e[type=husk,limit=1] HandItems[0].components.minecraft:custom_data.test
See the disconnection screen
Expected Result
If running the data get
command mentioned above, the client should not disconnect, and the result should be displayed correctly.
See Also
[MC-269173] - The server cannot send the client the system_chat packet containing deeply nested NBT data
MC-264510 - NBT paths can create NBTs that exceed depth limit
MC-261376 - Elements in a numeric array tag at the deepest level can be retrieved, but not be set
[MC-201769] - Copying deeply nested NBT causes StackOverflowError
Marked as fixed, but still happening in 1.20.5 release. Causing a lot of issues with players disconnecting. As clickable messages with colors will simply disconnect the client.