Mojira Archive
BDS-17848

/data modify on the elements of an empty list adds a tag to the list

Oops this is totally the wrong project please disregard ty

History2

Aeldrion

Changed description:

The bug

0

The data modify command works inconsistently when attempting to modify the elements in an NBT list using the [] pattern in an NBT path. Specifically, when modifying the elements of a non-empty list (e.g. data modify storage foo:bar MyList[] set value 0), all elements of the list are modified and the length of the list is unchanged. However, if the list is initially empty, one element is added to the list.

0

How to reproduce

0
    0
  • Run the following chat commands:0
    0
    0/data modify storage foo:bar MyList set value []0/data modify storage foo:bar AnotherList set value [1, 2, 3]0/data modify storage foo:bar MyList[] set value 50/data modify storage foo:bar AnotherList[] set value 50/data get storage foo:bar0
    0
  • 0
0
    0
  • AnotherList has been set to [5, 5, 5]
  • 0
  • MyList has been set to [5]. It is expected that MyList would rather be unchanged, consistently with what happens on non-empty lists.
  • 0
0

This also effects other data modify subcommands. data modify foo:bar MyList[] append value 0 creates a list inside MyList containing 0, {{data modify foo:bar MyList[] merge value

0{example: 0}0

}} creates a compound inside MyList, etc.

Oops this is totally the wrong project please disregard ty

[Mod] OcelotOnesie

Resolution: UnresolvedInvalid

Invalid
Aeldrion
0
1
Unconfirmed
1.19.41