> For the complete documentation index, see [llms.txt](https://edseries-plugins.gitbook.io/p/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://edseries-plugins.gitbook.io/p/features/enchantments/custom-enchantments.md).

# Custom Enchantments

With EdPrison custom enchantments system you will be able to make infinite and unique enchants with just using a config file!

## Events

### BlockBreakEvent

The enchant will be triggered when a block is broken.\
**Lazy Option**: This option batches triggers for performance. Instead of firing the enchant per block broken, it fires once per mining tick with the placeholder `%lazy.blocks%` = how many blocks were processed in that batch. For example, if you have a tokenminer enchantment that is triggered with a 100% proc chance all the time, it's better in performance to give the tokens per batch (`amount * %lazy.blocks%`) instead of every block mined.\
**Trigger enchant when X blocks broken (blocks-to-trigger)**: This option will override all the chance options. This is useful if you don't want to trigger enchantments by chance — they will trigger exactly by blocks broken (tracked across sessions), for example if you have blocks-to-trigger: 500 the enchant will trigger every 500 blocks. Enchants in this mode have the `%exact.times%` placeholder available in their actions.

### EnchantTriggerEvent{enchant}

The enchant will be triggered when another enchant is triggered (enchant chaining). You need to specify in brackets the enchant you want to listen. For example: EnchantTriggerEvent{tokenminer}.

### PlayerHoldPickaxe

The enchant will be triggered when a player holds their pickaxe. This is useful for [Skills Enchants](/p/features/enchantments/custom-enchantments/skills-enchants.md).

### PlayerUnHoldPickaxe

The enchant will be triggered when a player unholds their pickaxe. This is useful for [Skills Enchants](/p/features/enchantments/custom-enchantments/skills-enchants.md).

## Example

```yaml
myenchant:
  enabled: true
  type: custom
  event-trigger: BlockBreakEvent
  max-chance: 10
  max-level: 500
  currency: tokens
  starting-cost: 100
  increase-cost-by: 400
  starting-level: 0
  actions:
    - "givecurrency <variable>reward</variable> <currency>money</currency> <amount>1000</amount> <affectSummary>true</affectSummary> <affectMulti>true</affectMulti>"
    - "command <value>edp msg %player% &a+%edprison_notation_%reward.amount%% money!</value>"
```

After editing, run `/edprison reload`. Add a matching entry to `guis.yml` (`enchant-menu`) so players can buy it, and optionally a lore line on the pickaxe. The full list of actions is documented in [Actions](/p/features/enchantments/custom-enchantments/actions.md).
