Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269171

The client is disconnected when receiving the system_chat packet containing deeply nested NBT data

XMLWordPrintable

    • Plausible
    • Networking
    • Important
    • Platform

      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'
      

      This bug starts to affect since 24w09a.

      Steps To Reproduce

      Using Data Storage (Better Method)

      1. Set up a server after 24w09a version or join the singleplayer world
      2. Run the command using a Command Block or a Datapack function:
        data modify storage mc-269171 data set value [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]
        
      3. Also run the command:
        data get storage mc-269171 data
        
      4. See the disconnection screen

      Using HandItems of Mob (TL; DR)

      1. 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.
      2. Kill the all Husks already summoned
      3. 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:{}}}}]}
        
      4. 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
        
      5. Freeze the game ticking using tick freeze command
      6. Activate the Lever
      7. Make to run the game during 128 ticks using tick step 128 command
      8. Run the command:
        data get entity @e[type=husk,limit=1] HandItems[0].components.minecraft:custom_data.test
        
      9. 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

            gegy1000 [Mojang] Gegy
            NoEul NoEul
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: