After upgrading to 1.21, only the last attribute_modifier with the same UUID will be kept
After updating to 1.21, if the custom attribute_modifiers of an item have the same UUID, only the last one will be retained.
How to reproduce:
- Create a world in 1.20.6
- Run the following command:
/give @p minecraft:diamond_sword[minecraft:attribute_modifiers={modifiers:[{name:"a",uuid:[I;1683709482,44580970,-1540485464,1994649380],amount:6,operation:add_value,slot:mainhand,type:"minecraft:generic.attack_damage"},{name:"a",uuid:[I;1683709482,44580970,-1540485464,1994649380],amount:-2.4,operation:add_value,slot:mainhand,type:"minecraft:generic.attack_speed"}]}] - Observe the attribute_modifiers of the item:
→ +6 attack damage -2.4 attack speed
- Upgrade the world to 1.21
- Observe the attribute_modifiers of the item:
→ -2.4 attack speed
- Run the command:
/give @p minecraft:diamond_sword[minecraft:attribute_modifiers={modifiers:[{id:"minecraft:645b5e2a-02a8-406a-a42e-0ea876e3ef24",amount:6,operation:add_value,slot:mainhand,type:"minecraft:generic.attack_damage"},{id:"minecraft:645b5e2a-02a8-406a-a42e-0ea876e3ef24",amount:-2.4,operation:add_value,slot:mainhand,type:"minecraft:generic.attack_speed"}]}]→ Both attribute_modifiers appear, indicating that using the same ID is allowed.

2024-06-21, 12:09 AM
2024-06-28, 07:24 AM
2024-06-28, 07:24 AM
1
0
-