Skip to content

Commit

Permalink
Merge pull request #60 from Exanthiax/has_enchant_support
Browse files Browse the repository at this point in the history
Added has_enchant and enchant
  • Loading branch information
WillFP authored Jul 19, 2024
2 parents 4cddb8c + 58025ae commit b6ca83f
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
31 changes: 31 additions & 0 deletions docs/effects/all-conditions/has_enchant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# `has_enchant`

Requires a player to have certain enchant(s)
# Example Configs
```yaml
- id: has_enchant
args:
enchant: sharpness # The enchant ID
slot: mainhand # The slot
```
Multiple enchants and/or slots are supported:
```yaml
- id: has_enchant
args:
enchants: # All enchants must be present on a single item in the slot(s).
- looting # The enchant ID (enchant / enchant:<level> / enchant:<min-max>)
- knockback:2
- sharpness:1-3
slots: # The enchant must be present in ANY specified slot.
- mainhand
- 6
- helmet
```
| Arg | Example | Result |
| ----------------- | --------------- | ---------------------------------------------------------------------- |
| `enchant` | `sharpness` | Any level of the enchantment will satisfy the condition. |
| `enchant:level` | `sharpness:1` | Only the specified enchantment & level will satisfy the condition. |
| `enchant:min-max` | `sharpness:1-3` | Only enchant levels in the specified range will satisfy the condition. |
The options for slot are `mainhand`, `offhand`, `hands`, `helmet`, `chestplate`, `leggings`, `boots`, `armor`, `any`, or a number from 0-40 (to specify an exact slot).
11 changes: 11 additions & 0 deletions docs/effects/all-filters/enchant.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# `enchant`

The list of enchants that the `enchant_item` trigger should activate against

# Example Config
```yaml
filters:
enchant:
- sharpness
- knockback
```

0 comments on commit b6ca83f

Please sign in to comment.