Skip to content

[1.12] Item Attributes

Insane96 edited this page Sep 17, 2023 · 3 revisions

The Item Attribute object is used to add attribute modifiers to mobs equipped items.

Item Attribute

That's a list of all the keys available for the item attribute object, if (optional) is not present then the key is REQUIRED.

  • modifier: the modifier name, modifiers with the same name do not stack (e.g. if I have a chestplate with the modifier "moreHealth" that gives 10 more health and leggings with the modifier "moreHealth" that give 15 more health, I'll not have 25 more health since the same is the same, I'll only have one of the two, so only 10 more health or 15 more health ... don't remember the order on which are applied, so who has the priority)
  • attribute_name: the attribute to modify. Those are the vanilla ones
  • operation: how the modifier will affect the attribute. Valid values are addition, multiply_base, multiply_total
  • amount: min and max value possible for the modifier
    • min: minimum modifier value
    • max: maximum modifier value, (optional, if omitted will be equal to min)
  • id: UUID of the modifier, (optional, if omitted a new random one will be generated)
  • slot: slot to apply the modifier. Valid values are MAINHAND, OFFHAND, HEAD, CHEST, LEGS, FEET. (optional, if omitted will be set to the current Equipment slot)

Example

{
    "mob_id": "minecraft:zombie",
    "equipment": {
        "head": {
            "chance": {
                "amount": 10
            },
            "items": [
                {
                    "id": "minecraft:leather_helmet",
                    "weight": 1,
                    "attributes": [
                        {
                            "modifier": "healtyHelmet",
                            "attribute_name": "generic.maxHealth",
                            "amount": {
                                "min": 10
                            },
                            "operation": "addition"
                        }
                    ]
                }
            ]
        }
    }
}
Clone this wiki locally