> For the complete documentation index, see [llms.txt](https://yowsef-development.gitbook.io/yowsef-development-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://yowsef-development.gitbook.io/yowsef-development-docs/untitled/configuration/villagers-config.md).

# villagers config

```yaml
# ============================================================
# PrimeEnchants  |  Villager Trade Injection
# villagers.yml
# ============================================================
#
# Controls how custom enchanted-book trades are injected into
# Librarian villager trade lists alongside vanilla trades.
#
# KEY DESIGN GUARANTEES
# ─────────────────────
#  • Vanilla trades are NEVER removed or replaced.
#  • Custom trades are APPENDED to the villager's recipe list.
#  • Injection state is stored in PersistentData on the entity,
#    so it survives server restarts and chunk reloads.
#  • The same enchant cannot appear twice on one villager when
#    prevent_duplicates is true.
#
# VILLAGER LEVELS
# ───────────────
#  NOVICE (1)  →  APPRENTICE (2)  →  JOURNEYMAN (3)
#  EXPERT (4)  →  MASTER (5)
#
# HOW DEFAULTS WORK
# ─────────────────
#  Any registered enchant NOT listed under "enchantments:" uses
#  the values in "defaults:".
# ============================================================
villagers:
  enabled: true
  inject_into_librarians: true

  settings:
    max_custom_trades_per_villager: 3
    include_vanilla_trades: true
    randomize_trades: true
    reroll_on_level_up: false
    prevent_duplicates: true

  trade_costs:
    base_book_cost: 1
    emerald_min: 5
    emerald_max: 64

  enchant_trade_settings:
    weight_system: true
    allow_treasure_enchants: false
    allow_curse_enchants: false

  defaults:
    enabled: true
    weight: 10
    emerald_cost: -1
    book_cost: 1
    villager_level: NOVICE
    max_level: -1

  enchantments:
    # (Overrides removed for brevity in docs, see full file in plugin folder)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://yowsef-development.gitbook.io/yowsef-development-docs/untitled/configuration/villagers-config.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
