Enchantment Mechanic
Type:EnchantmentMechanic (data class)
Mechanics define modular behaviors attached to custom_enchantment_definition. Each mechanic listens for a specific game event and executes actions when criteria are met.
Fields
| Field | Type | Default | Description |
|---|---|---|---|
event | EnchantmentEvent | PLAYER_ATTACK | Game event that triggers this mechanic |
criteria | List<Criteria> | [] | Conditions that must be met for the actions to execute |
actions | List<Ref<TriggerableEntry>> | [] | Actions executed when criteria are met |
clientSideEffects | List<Ref<TriggerableEntry>> | [] | Client-side only effects (particles, sounds) via packets |
runOnLevel | Int | 0 | Enchantment level required to run this mechanic. 0 means all levels |
chance | Int | 100 | Chance to trigger this mechanic (0-100%) |