has_enchant

Passes when the entity has an item with the specified enchantment in the specified slot.

Categories: inventory

Required arguments

Key(s)DescriptionType
slot \| slotsThe equipment slot(s) to check for the enchantment.STRING_LIST
enchant \| enchantsThe enchantment(s) to require, optionally with a level or range (e.g. sharpness:3-5).ENCHANTMENT_LIST

Example

conditions:
  - id: has_enchant
    args:
      slot: 
        - "mainhand"
        - "9"
      enchant: 
        - "sharpness:3-5"
        - "unbreaking:2"