Mojira Archive
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.

Works As Intended

beebee

2024-06-21, 12:09 AM

2024-06-28, 07:24 AM

2024-06-28, 07:24 AM

1

0

Confirmed

Datafixer

1.21

-