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

/execute store does not work with a conditional array selection

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.17.1, 1.21
    • Confirmed
    • Commands

      Usually, when using execute store with data get, when the selected path is an array, the length of the array is returned back and stored at the desired location.
      This does not seem to work with a conditional array selection.

      Steps to Reproduce

      1. /data merge storage bug:test {testArray: [{bool: true}, {bool: false}, {bool: true}]}
      2. /scoreboard objectives add test dummy
      3. /scoreboard objectives setdisplay sidebar test
      4. /execute store result score $test test run data get storage bug:test testArray[{bool: true}]

        -> Stores 0

      5. /execute store result score $test test run data get storage bug:test testArray

        -> Stores 3

      Observed result

      The value "0" is stored and the error message "This argument accepts a single NBT value" is printed (which is simply wrong, as the 2nd case with a non-conditional access shows)

      Expected result

      The value "2" is stored to the score

            Unassigned Unassigned
            Schortan [Mod] NeunEinser
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              CHK: