mojira.dev
MC-273667

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:

  1. Create a world in 1.20.6

  2. 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"}]}]
  3. Observe the attribute_modifiers of the item:
    → +6 attack damage -2.4 attack speed ✔

  4. Upgrade the world to 1.21

  5. Observe the attribute_modifiers of the item:
    → -2.4 attack speed ❌

  6. 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. ✔

Comments 1

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 HistorySnapshot Version HistoryThe 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

Bee

(Unassigned)

Confirmed

Datafixer

1.21

Retrieved