Dynamic Villager Trades Mod (1.21.1, 1.20.1) – Train Villagers to Stock What
Dynamic Villager Trades Mod overhauls villager trading so you do not need huge trading halls anymore. Instead of fixed lists, this mod refreshes villager offers each day or every time they restock. Villagers also remember what you buy and sell, so a small group of villagers slowly specializes in the items and enchantments you want. You can tune how fast trades settle and refresh with four config options, customize or replace professions using JSON datapacks with two extra offer types, and export your current setup with a built-in command. The mod works with trades from other mods, does not work with mods that replace vanilla trades, and only needs to be on the server in multiplayer.
![]()
Features:
- Trade Memory: Villagers choose new offers based on your past trades. For example, buying Looting books from a librarian makes that villager more likely to offer sword and luck enchantments later.
- Refreshing Trades: Villagers update their offers every time they restock or each day, depending on your settings. The more you buy or sell an item, the higher the chance that trade comes back after a restock, and offers always refresh when a villager levels up.
- Smaller Trading Setups: Lets you get the items and enchantments you want from a few specialized villagers instead of building giant trading halls.
- Datapack Support: Allows you to add custom trades or replace full villager professions with JSON datapacks.
- Builds trade configs automatically at runtime for trades from other mods and missing professions, grouping offers by tool materials, enchantment names, and vanilla trade levels so optional trades specialize within their own level.
- Adds two custom trade offer types for datapacks:
enchant_specific_bookandsell_specific_potion_holding_item. - Stops librarians from selling two books with the same enchantment at once by default, such as Protection III and Protection IV.
- Includes an option for Enchant & Repair compatibility that puts Curse of Vanishing on every book sold by librarians.
- Keeps modded trades that cannot be exported to a datapack, like the random map from Supplementaries, working at runtime as long as a datapack does not replace that entire profession.
- Needs to be installed only on the server side in multiplayer worlds.
- Does not work with other mods that replace vanilla villager trades or control trades through their own JSON systems.
Datapack Mechanics:
- Each profession JSON file stores trade groups inside an
offersdictionary, where you can setmin_trades,max_trades, optionalaffinity, and grouprandomnessso lower numbers help villagers settle on trades faster. - Setting
replacetotrueoverwrites an existing profession or trade group, whilefalseadds your new trades to the existing group with the same name. - Group names decide the display order in the trade menu, so default group names start with numbers instead of sorting alphabetically.
- Each trade entry defines the minimum villager
level(such asapprentice), theoffertype, theattributespoints gained when traded, and an optionalaffinity. - Villager attributes act as a hidden memory that starts at 0 and changes whenever a matching trade is used, and you can create any custom attribute name without declaring it first.
- Affinities control how strongly an attribute boosts a trade’s pick chance, and they calculate automatically from attribute points if left blank, though you can set both separately when needed.
- Putting
affinityon a trade group instead of a single trade makes this mod pick the group first and then a trade inside it, stopping large groups from overpowering smaller ones whenmax_tradesis greater thanmin_trades.
Librarian Enchanted Book Rules:
- Default librarian setups use four matching enchanted book groups that only differ in the experience they give, keeping the feel close to vanilla trading.
- Trades with closely matching affinities, such as
toolandfast, make a villager switch randomly between similar books like Efficiency and the custom book. - Trades with rare custom attributes that do not match other offers take many restocks to appear, while pairing a custom attribute with a common one like
firelets players boost the chance by buying books like Fire Aspect. - Negative attribute increments and affinities work best only when a book is meant to clash with another attribute, such as giving a water-related book a negative
firevalue. - Default book weights add
1toenchanter, from-1to0.5tolow_levelbased on the enchantment’s max level (such as-1for Fire Aspect II or Efficiency V and0.5for Efficiency II),1to the primary category (armor,sword,tool,bow,fishing,trident,crossbow, orall), and1split across secondary categories (such as0.333each formelee,luck, andresource).
Commands:
/dynamicvillagertrades export: creates a datapack from the current trade setup, including auto-generated modded trades, so you can edit them. Some modded trades, such as the random map from Supplementaries, cannot be encoded and cause that profession’s export to fail.
Configuration:
global_randomness: defaults to1.0and multiplies each group’s randomness. Lower numbers make villagers settle on specific trades faster, while higher numbers make it take longer.refresh_delay: defaults to0and sets how many times a villager must restock before its trades change. Trades still refresh whenever the villager levels up.no_book_duplicates: defaults totrueand stops each librarian from selling two books with the same enchantment at once, such as Protection III and Protection IV.enchant_repair_compat: defaults tofalseand adds Curse of Vanishing to every book sold by librarians for compatibility with Enchant & Repair.
How to Use:
- Trade the same items or enchantments with one villager several times to build up its hidden attributes; for example, buying Looting books from a librarian makes sword and luck enchantments show up more often.
- Wait for the villager to restock, let a day pass, or level the villager up so its offers update based on your past trades and your
refresh_delaysetting. - Type
/dynamicvillagertrades exportin chat to generate a datapack with your current trade setup, including auto-generated modded trades, so you can edit the JSON files. - Edit a profession JSON file in your datapack and set
replacetotrueto overwrite a profession or group, or set it tofalseto add new trades to an existing group. - Add each new enchanted book to all four default librarian book groups if you do not replace the whole profession, and use existing attributes like
enchanter,low_level, and standard categories so trade weights stay balanced. - Keep
replaceset tofalsewhen a modded profession fails to export due to an unsupported trade (such as the random map from Supplementaries), so your extra trades load while the original modded trade keeps working at runtime. - Change
global_randomness,refresh_delay,no_book_duplicates, andenchant_repair_compatin the config file to control how fast villagers specialize, how often trades refresh, and how librarian books behave.
Screenshots:







How to Install:
New to Minecraft? Follow our step-by-step guide to install Mods on your PC.View Guide
Dynamic Villager Trades Mod Download Links
For Minecraft 1.21.1, 1.21
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.20.1, 1.20
Forge version: Download from Server 1 – Download from Server 2
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.19.2
Forge version: Download from Server 1 – Download from Server 2
Fabric version: Download from Server 1 – Download from Server 2
For Minecraft 1.18.2
Fabric version: Download from Server 1 – Download from Server 2
What is your stance on mods that feel 'overpowered' or break vanilla balance?
32 responses · See the full results →
0





















This post has no comments yet. Be the first — your comment will appear here.