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:
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"}]]
❌ Notice that it tells you that
body
is an invalid element nameNow 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"}]]
Tame a wolf and equip the wolf with this wolf armor
✔ Notice that the wolf is walking faster, confirming that the attribute modifier is applied
⚠️ 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.
Affects 24w11a.