mojira.dev
MC-270223

JSON components saved in different order

When generating an via a loot_table JSON, and modifying another item with the 

/data merge item

 command, even though the order of the NBT components is the same on both, it saves one of them in a different order in the level.dat file.

For example, here's the NBT of an item created using the loot table, and given using the `/loot` command to the player

display: {
  Lore: {
    [0]: '{"text":"Drop onto an enchanting table","color":"gray","italic":false}'
    [1]: '{"text":"With an enchanted book","color":"gray","italic":false}'
    [2]: '{"text":"To upgrade the book!","color":"gray","italic":false}'
  }
  Name: '{"text":"Upgrade Rune","color":"light_purple","italic":false}'
}

And here's the item when modified using the `/data merge entity` command

display: {
  Lore: {
    [0]: '{"text":"Drop onto an enchanting table","italic":false,"color":"gray"}'
    [1]: '{"text":"With an enchanted book","italic":false,"color":"gray"}'
    [2]: '{"text":"To upgrade the book!","italic":false,"color":"gray"}'
  }
  Name: '{"text":"Upgrade Rune","italic":false,"color":"light_purple"}'
}

note the order of the lore and name's tags such as colors and italics.

Here's the command I used to modify the item's nbt: https://pastebin.com/rfVhHA4Y
And here's the JSON that generates the original version: https://pastebin.com/tmuULRAY

As you can see in both the command and JSON the order of the italics and the color is in the same order, text, color, italics.

 

 

Comments 1

How can I reproduce this issue?

Yoav_TC

(Unassigned)

Unconfirmed

(Unassigned)

1.20.4

Retrieved