Mojira Archive
MC-236889

/execute store does not work with a conditional array selection

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

Unresolved

[Mod] NeunEinser

2021-09-17, 05:37 AM

2024-07-16, 06:54 AM

2

2

Confirmed

Commands

command, execute, store

1.17.1, 1.21

-