When using the following command, the expected result is that all enchantments from the first item in the chest get copied to the second item in the chest since "Enchantments[]" doesn't specify an index number. According to the changelong, "Add []
to select all elements from list".
/data modify block 1091 68 -88 Items[1].tag.Enchantments[] merge from block 1091 68 -88 Items[0].tag.Enchantments[]
Instead the command only copies the last index in the list to the desired item.
For example, a diamond sword in the first slot has unbreaking and sharpness in that order. An iron sword in the second slot has no enchantments. After running the command, the only enchantment copied over to the iron sword is the one indexed last in the diamond sword. In this case, it would only receive sharpness.
merge
is for compounds, you're essentially creating and selecting one compound from the unenchanted sword, then setting it equal to a collection of compounds from the enchanted sword, which isn't the desire here.It looks like you want
set
, and remove the[]
brackets afterEnchantments
.set
can be used for any tag to create or replace it.