mojira.dev
MC-268850

Attribute Modifier: Not updated when switching items in hotbar

When switching between two items in the hotbar, each with different "Attribute Modifier" values, the modification does not update correctly.

Steps to Reproduce:
1. Get two items in the hotbar with the same attribute (e.g "generic.scale").

  • The first item has an "Attribute Modifier" value of 1.0.

  • The second item has an "Attribute Modifier" value of 100.0.
    2. Select the first item to apply the scale effect.
    3. Directly select the second item.

Expected Result:
The scale modification from the first item should be replaced by the scale effect of the second item

Actual Result:
Despite switching items in the hotbar, the scale value remains that of the first item; the scale effect is still applied but with the incorrect value.

// First Item
/give @s minecraft:iron_axe[attribute_modifiers={modifiers:[{type:'minecraft:generic.scale',uuid:[1,2,3,4],slot:"mainhand",name:'Big!',amount:100.0,operation:'add_multiplied_base'}]}]

// Second Item
/give @s minecraft:iron_axe[attribute_modifiers={modifiers:[{type:'minecraft:generic.scale',uuid:[1,2,3,4],slot:"mainhand",name:'Big!',amount:1.0,operation:'add_multiplied_base'}]}]

Attachments

Comments 2

I can confirm this in 24w09a and attached a video demonstrating the bug.

[media]

Note it works fine if the two modifiers have different UUIDs

Hardel

gegy

Community Consensus

Platform

Very Important

Commands, Items

24w09a

24w10a

Retrieved