Mojira Archive
MC-276943

Using "slot" in minecraft:attributes effect component doesn't actually restrict slot

Creating a custom enchantment that modifies generic.armor should be restricted by slot, e.g. chest, but still works even when equipped to a different slot, e.g. feet.

        "minecraft:attributes": [
            {
                "amount": {
                    "type": "minecraft:linear",
                    "base": 1.0,
                    "per_level_above_first": 1.0
                },
                "attribute": "minecraft:generic.armor",
                "id": "ifiht:enchantment.solar_aegis",
                "operation": "add_value",
                "slot": "chest"
            }
        ] 

working test datapack zip attached.

How to reproduce:

  1. Join a new world with the attached data pack enabled.
  2. Execute the following command:
    /give @s golden_boots[enchantments={levels:{'ifiht:solar_aegis':1}}]
  3. Equip the boots you were given.

Expected result:

Golden boots with the enchantment would only provide +1 armor total, since the enchantment only affects items worn in the chest slot.

Observed result:

Golden boots with the enchantment add a total of +2 armor points to the player, even though the enchantment only applies the generic.armor boost to the chest slot.

Unresolved

ifiht

2024-09-24, 09:19 PM

2024-10-02, 07:16 AM

5

1

Confirmed

Low

Platform

Data Packs, Enchantments

1.21.1, 24w39a

-