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

Inserting elements into collection tags can be aborted in the middle

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.16.5, 1.17 Release Candidate 1, 1.17, 1.17.1, 21w37a, 1.18.1, 22w03a, 22w05a, 1.18.2 Pre-release 1, 1.18.2, 22w11a, 22w12a, 1.19 Release Candidate 2, 1.19, 1.19.1, 1.19.2, 1.19.3 Release Candidate 1, 1.19.3 Release Candidate 2, 1.19.3, 23w03a, 23w05a, 1.19.4, 23w12a, 23w18a, 1.20 Pre-release 7, 1.20.2, 23w42a
    • Confirmed
    • Commands

      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]]
      2. /data modify storage mc-227538: list[] insert 1 value 3

        Invalid list index: 1

      3. /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.

            Unassigned Unassigned
            intsuc intsuc
            Votes:
            4 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: