Hey im looking to create a script that disables netherite armor. however when i search meta docs
https://meta.denizenscript.com/Docs/Search/item#player equips|unequips armor|helmet|chestplate|leggings|boots
The player equip event says it triggers when a player unequips an armor not when he tries to equip it
And anyway it also works as it says
prevent_netherite_armor_equip:
type: world
debug: false
events:
on player clicks item in inventory:
- if <context.slot_type.contains_text[ARMOR]> && <context.item.material.name.contains_text[NETHERITE]>:
- determine cancelled
- narrate "<red>Wearing Netherite armor is not allowed."
on player right clicks item:
- if <context.item.material.name.contains_text[NETHERITE]> && <context.item.material.name.contains_any_text[_HELMET|_CHESTPLATE|_LEGGINGS|_BOOTS]>:
- determine cancelled
- narrate "<red>You can't equip Netherite armor."
on player inventory slot changes:
- if <context.slot> >= 36 && <context.slot> <= 39:
- if <context.new_item.material.name.contains_text[NETHERITE]>:
- inventory set d:<context.old_item> slot:<context.slot> o:<player.inventory>
- give <context.new_item> to:<player.inventory>
- narrate "<red>Netherite armor can't be worn."
Here i can equip it but not unequip. and it duplicates maybe because it doesnt actual cancel the armor and give a new one. rather it retains the one that is supposed to be canceled and still gives another one
Search for 'item'