> For the complete documentation index, see [llms.txt](https://linparlab.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://linparlab.gitbook.io/docs/configuration/enchantments.md). Agents can also search and read this documentation through its [MCP server](https://linparlab.gitbook.io/docs/~gitbook/mcp).

# enchantments.yml

The unknown section supplies a default weight for a recognized ID without its own entry. The weights section maps enchantment IDs to weight definitions. Edit an existing ID in place.

```yaml
unknown:
  base: 0.08
  per-level: 0.025
  level-cap: 10
weights:
  'minecraft:efficiency':
    base: 0.04
    per-level: 0.025
    level-cap: 12
    levels:
      '5': 0.20
```

Each definition requires base, per-level and level-cap. The cap ranges from 1 to 32767. Optional levels entries override the whole weight at the capped level. Keys in levels must fall within the cap. Base and override values range from 0 to 2000. Per-level ranges from 0 to 1000.

Merge the example into the existing file to retain other weights. Use `/repair debug item` to verify the exact ID and level. See [Custom Enchantments](https://linparlab.gitbook.io/docs/integrations/custom-enchantments.md) and the [formula](https://linparlab.gitbook.io/docs/reference/repair-cost.md).
