Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-269143

Attribute modifiers cannot exclusively target the "body" slot

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • 24w13a
    • 24w10a, 24w11a, 24w12a
    • None
    • Confirmed
    • Commands
    • Important
    • Platform

      body is an invalid slot to use in attribute modifiers. This is unexpected, because 24w05a added the slot to the entity_properties equipment predicate (used for example by wolf armor). It makes it impossible to create attribute modifiers that only work on the body slot.

      How to reproduce:

      1. Try to run the following command
        /give @s minecraft:wolf_armor[attribute_modifiers=[{type:"generic.movement_speed",name:"Test",uuid:[0,2,4,8],amount:0.1,operation:"add_value",slot:"body"}]]
        
      2. Notice that it tells you that body is an invalid element name
      3. Now run this similar command, that uses any as slot
        /give @s minecraft:wolf_armor[attribute_modifiers=[{type:"generic.movement_speed",name:"Test",uuid:[0,2,4,8],amount:0.1,operation:"add_value",slot:"any"}]]
        
      4. Tame a wolf and equip the wolf with this wolf armor
      5. Notice that the wolf is walking faster, confirming that the attribute modifier is applied
      6. Notice that the player also receives this speed buff by holding the wolf armor, conclude that it is impossible to create attribute modifiers that only work on the body slot.

      Code analysis:
      The EquipmentSlot enum has a BODY value, however the EquipmentSlotGroup enum has no value that matches the body slot.

            HugoHagglund [Mojang] SHugoh
            Misoloo [Helper] Misode
            Votes:
            5 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: