mojira.dev
MC-227538

Inserting elements into collection tags can be aborted in the middle

The bug

Inserting elements into collection tags by /data modify ... insert ... is aborted on the first failure. This behavior is inconsistent with other commands like /data modify ... set ..., which ignores failures that occur during the process.

How to reproduce

  1. /data modify storage mc-227538: list set value [[0], [], [2]]
    /data modify storage mc-227538: list set value [[0], [], [2]]
  2. /data modify storage mc-227538: list[] insert 1 value 3
    /data modify storage mc-227538: list[] insert 1 value 3

    → ❌ Invalid list index: 1

  3. /data get storage mc-227538: list
    /data get storage mc-227538: list

Expected behavior

Storage mc-227538: has the following contents: [[0, 3], [], [2, 3]], element 3 is inserted in the first and the last list.

Actual behavior

Storage mc-227538: has the following contents: [[0, 3], [], [2]], element 3 is inserted in the first list, but not in the last list.

Comments 0

No comments.

intsuc

(Unassigned)

Confirmed

Commands

nbt

1.16.5, 1.17 Release Candidate 1, 1.17, 1.17.1, 21w37a, ..., 23w18a, 1.20 Pre-release 7, 1.20.2, 23w42a, 1.21.4

Retrieved