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. ✔
Thank you for your report!
After consideration, the issue is being closed as Working as Intended.
Please note, that mechanics of the game may change between updates.
Things such as graphics, sounds, world creation, biomes, redstone, villagers, and animals may not work the same in current versions.
Full Version History – Snapshot Version History – The official Minecraft feedback site
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki