Mojira Archive
MC-271098

AttributeModifiers affection error when placing item on "mainhand" from other functional slots

This bug was first found on Minecraft Java Edition 1.20.5

When items with AttributeModifiers (of the same UUID) are placed from other functional slots (head, offhand etc.) onto mainhand slot, the AttributeModifier does not seem to do effect to the owner anymore. 

Also tested on Minecraft Java 1.20.2 to have the same issue. This bug can potentially occur in early versions as it seems to be not sourced from the implementation of components

 

Procedures to Reproduce:

  1. Create any singleplayer vanilla world with cheats on
  2. For versions 1.20.5+, run command in console +/give @s minecraft:golden_helmet[minecraft:attribute_modifiers={modifiers:[ {type:"minecraft:generic.jump_strength",uuid:[1,1,1,1],operation:"add_value",amount:0.5,name:"jump_boost",slot:"hand"}

    ,{type:"minecraft:generic.jump_strength",uuid:[1,1,1,1],operation:"add_value",amount:0.5,name:"jump_boost",slot:"head"}]}] 1+
    For affected versions prior to 1.20.5, run command in console 

+/give @s minecraft:golden_helmet{AttributeModifiers:[

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:mainhand,Operation:0,Amount:0.1}

,{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:offhand,Operation:0,Amount:0.1},{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:head,Operation:0,Amount:0.1}]}+

  1. Place the item on offhand or head
  2. Place the item on mainhand directly

Expected Outcome: 

The increased generic.jump_strength or generic.movement_speed attribute modifier that affects when on mainhand remains effective

Actual Outcome:

The increased generic.jump_strength or generic.movement_speed attribute modifier that affects when on mainhand is no longer in effect, after displacing it from head slot or offhand.

Video Demonstration (see comments)

The affection of AttributeModifiers was tested using the generic.jump_strength attribute. On Minecraft Java 1.20.2, generic.movement_speed was used instead

Command Lines used:

"different uuid": /give @p minecraft:golden_helmet{AttributeModifiers:[

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:mainhand,Operation:0,Amount:0.1}

,

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,2],Slot:offhand,Operation:0,Amount:0.1}

,

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,3],Slot:head,Operation:0,Amount:0.1}

]}

"same uuid": /give @p minecraft:golden_helmet{AttributeModifiers:[

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:mainhand,Operation:0,Amount:0.1}

,

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:offhand,Operation:0,Amount:0.1}

,

{AttributeName:"generic.movement_speed",Name:"generic.movement_speed",UUID:[I;1,1,1,1],Slot:head,Operation:0,Amount:0.1}

]}

"slot: hand": /give @p minecraft:phantom_membrane[minecraft:attribute_modifiers={modifiers:[

{type:"minecraft:generic.jump_strength",uuid:[0,9,0,1952],operation:"add_value",amount:0.5,name:"op_jump",slot:"hand"}

]},minecraft:max_stack_size=1] 1

"slot: mainhand": /give @p minecraft:phantom_membrane[minecraft:attribute_modifiers={modifiers:[

{type:"minecraft:generic.jump_strength",uuid:[0,9,0,1952],operation:"add_value",amount:0.5,name:"op_jump",slot:"mainhand"}

]},minecraft:max_stack_size=1] 1

"slot: offhand": /give @p minecraft:phantom_membrane[minecraft:attribute_modifiers={modifiers:[

{type:"minecraft:generic.jump_strength",uuid:[0,9,0,1952],operation:"add_value",amount:0.5,name:"op_jump",slot:"mainhand"}

,

{type:"minecraft:generic.jump_strength",uuid:[0,9,0,1952],operation:"add_value",amount:0.5,name:"op_jump",slot:"offhand"}

]},minecraft:max_stack_size=1] 1

Duplicate

KevinSheng

2024-04-24, 02:18 PM

2024-05-09, 01:33 AM

2024-05-09, 01:27 AM

1

1

Unconfirmed

(Unassigned)

1.20.5

-