has_enchant
Passes when the entity has an item with the specified enchantment in the specified slot.
Categories: inventory
Required arguments
| Key(s) | Description | Type |
|---|---|---|
slot \| slots | The equipment slot(s) to check for the enchantment. | STRING_LIST |
enchant \| enchants | The 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"