In versions 1.20.4 or before, an item's AttributeModifiers
tag was accepted correctly even if the Operation
or Name
fields were omitted. However, if you open a world in snapshot 24w09a with a custom item that has an attribute with one of these fields omitted, the tag will simply disappear.
Steps to reproduce
Create a world with version 1.20.4 with cheats enabled
Run these commands to obtain the items.
// without Name give @p stone{AttributeModifiers:[{AttributeName:"minecraft:generic.movement_speed",Amount:1d,Operation:0,UUID:[I;1,1,1,1]}]} // without Operation give @p stone{AttributeModifiers:[{AttributeName:"minecraft:generic.movement_speed",Name:"",Amount:1d,UUID:[I;1,1,1,1]}]}
When you hold these items in your hands, you will notice that your movement speed increases correctly, even though the fields are missing.
Now, enter the same world in 24w09a
Expected behaviour
The items should be transferred correctly, along with their attributes, which should still increase the player's movement speed.
Observed behaviour
The items are not upgraded correctly and and their AttributeModifiers
tag disappears completely.
Apologies for the incorrect resolution as duplicate of MC-269037. It wasn't clear to me that this is a world upgrade issue. I've edited the bug report slightly to make this clearer.