Before Snapshot 24w09a, where Minecraft NBT data was changed to be stored efficiently with some issues, enchantments NBT data were stored in the path of Item.tag.Enchantments in list type, allowing to edit data with modify <...> append/prepend.
Example before 24w09a:
NBT data of test item: {Item:{id:"minecraft:netherite_sword",Count:1b,tag:{Enchantments:[{id:"minecraft:sharpness",lvl:255s}]}} - Before
Type: /data modify entity @e[type=minecraft:item,limit=1,sort=nearest] Item.tag.Enchantments append set value {id:"minecraft:unbreaking",lvl:255s}
Then it will be: {Item:{id:"minecraft:netherite_sword",Count:1b,tag:{Enchantments:[{id:"minecraft:sharpness",lvl:255s},{id:"minecraft:unbreaking",lvl:255s}]}}
By using append because Enchantments NBT is a list-type, we can add enchantments easily through modify <...> append. However, 24w09a ruined NBT in all ways. After 24w09a, Enchantments NBT is stored in the path of {"minecraft:enchantments":{levels:{"minecraft:sharpness":255s,"minecraft:unbreaking":255s}}}, meaning no longer to edit easily via append. Beyond this problem, I am convinced that this kind of problem is not only for Enchantments NBT, but the problem is the tip of the iceberg. All changes in storing NBT from a list type to not a list type firmly share this problem. Applicated NBT types are (written in before 24w09a):
- Enchantments
- StoredEnchantments
Therefore, I firmly request Mojang to notice this problem and resolve it.
Please sign in to leave a comment.
0 Comments