mojira.dev
MC-264510

NBT paths can create NBTs that exceed depth limit

The bug

When modifying NBTs by an NBT path, default NBTs are created by NBT path nodes except the last one so that the modification succeeds as much as possible.
However, this could create NBTs that exceed the NBT depth limit (512) introduced in 1.19.3 Release Candidate 1.

How to reproduce

  1. Run the following command. (You will need either an mcfunction, or a command block, because it is too long for chat.)

    data modify storage mc-264510: a{b: [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]}.c set value 0

    Expected: Resulting NBT too deeply nested
    Actual: Modified storage mc-264510:

  2. Reopen the world

  3. Run the following command

    data get storage mc-264510:

    → ❌ Error loading saved data: command_storage_mc-264510
    java.lang.RuntimeException: Tried to read NBT tag with too high complexity, depth > 512

Comments 2

I can confirm that following these reproduction steps results in an error being logged. But to clarify, is the expected behavior for the command in step 1 to fail?

Yes, it should fail and keep the storage unmodified because it creates an NBT that exceeds the NBT depth limit.

intsuc

(Unassigned)

Confirmed

Platform

Normal

Commands

1.20.1, 23w31a, 23w32a, 1.20.2, 23w42a, ..., 24w33a, 1.21.4, 25w04a, 1.21.5, 25w16a

Retrieved