Earlier Versions
Name | Size | Uploaded | Game Version | Downloads | |
Custom Villager Trades 1.19.1 v17 beta | 46.93 KB | Jul 26, 2022 | 1.19.1 | 1 | Download |
Custom Villager Trades 1.18.2 v17 beta | 46.71 KB | Mar 28, 2022 | 1.18.2 | 4,298 | Download |
Custom Villager Trades 1.18.1 v17 beta | 47.18 KB | Mar 28, 2022 | 1.18.1 | 667 | Download |
Custom Villager Trades 1.16 v17 beta | 47.24 KB | Mar 28, 2022 | 1.16.5 | 15,446 | Download |
Custom Villager Trades 1.18.2 V16 beta | 46.21 KB | Mar 25, 2022 | 1.18.2 | 168 | Download |
Custom Villager Trades 1.18.1 V16 beta | 46.67 KB | Mar 25, 2022 | 1.18.1 | 98 | Download |
Custom Villager Trades 1.16 V16 beta | 46.74 KB | Mar 25, 2022 | 1.16.5 | 212 | Download |
Custom Villager Trades 1.18 V15 beta | 46.31 KB | Feb 23, 2022 | 1.18.1 | 1,067 | Download |
Custom Villager Trades 1.16 V15 beta | 46.39 KB | Feb 23, 2022 | 1.16.5 | 7,089 | Download |
Custom Villager Trades 1.18 V14 beta | 42.66 KB | Jan 15, 2022 | 1.18.1 | 2,037 | Download |
Custom Villager Trades 1.16 V14 beta | 42.66 KB | Jan 15, 2022 | 1.16.5 | 3,349 | Download |
Custom Villager Trades 1.18 V13 beta | 42.63 KB | Dec 1, 2021 | 1.18.1 | 1,998 | Download |
Custom Villager Trades 1.17 V13 beta | 42.64 KB | Nov 30, 2021 | 1.17.1 | 835 | Download |
Custom Villager Trades 1.16 V13 beta | 42.97 KB | Nov 30, 2021 | 1.16.5 | 7,424 | Download |
Custom Villager Trades 1.17 V12 beta | 37.73 KB | Sep 28, 2021 | 1.17.1 | 2,066 | Download |
Custom Villager Trades 1.16 V12 beta | 37.69 KB | Sep 28, 2021 | 1.16.5 | 554,876 | Download |
Custom Villager Trades 1.17 V11 beta | 30.65 KB | Aug 6, 2021 | 1.17.1 | 2,131 | Download |
Custom Villager Trades 1.16 V11 beta | 30.48 KB | Aug 6, 2021 | 1.16.5 | 55,959 | Download |
Custom Villager Trades 1.17 V10 beta | 29.29 KB | Aug 4, 2021 | 1.17.1 | 151 | Download |
Custom Villager Trades 1.16 V10 beta | 29.16 KB | Aug 4, 2021 | 1.16.5 | 190 | Download |
Custom Villager Trades 1.17 V9 beta | 26.45 KB | Jul 27, 2021 | 1.17.1 | 356 | Download |
Custom Villager Trades 1.16 V9 beta | 26.12 KB | Jul 27, 2021 | 1.16.5 | 403 | Download |
Custom Villager Trades V8 beta | 25.94 KB | Jul 22, 2021 | 1.16.5 | 422 | Download |
Custom Villager Trades V7 beta | 24.61 KB | Jul 17, 2021 | 1.16.5 | 547 | Download |
Custom Villager Trades V6 beta | 22.67 KB | Jul 11, 2021 | 1.16.5 | 1,397 | Download |
Custom Villager Trades V5 beta | 19.51 KB | Jun 24, 2021 | 1.16.5 | 4,629 | Download |
Custom Villager Trades V4 beta | 18.47 KB | Jun 3, 2021 | 1.16.5 | 1,185 | Download |
Custom Villager Trades v2 beta | 11.53 KB | Apr 21, 2021 | 1.16.5 | 14,495 | Download |
Custom Villager Trades v1 beta | 11.52 KB | Mar 31, 2021 | 1.16.5 | 563 | Download |
Screenshots
Description
This mod is designed to expand upon the vanilla villager trading offers. It is made for modpack authors.
By default, no extra trades are added. You need to go in to the config file and add them yourself!
That being said, if you load this mod for the first time it will create an example trade for the armorer profession (which you should modify or remove).
How does it work?
This mod reads json files from the "config/custom villager trades" directory. The directory will be created (with an example file) when you load the mod for the first time (and if no config files are present).
The profession modified will depend on the file name. For example, a file called 'farmer.json' will apply trades to the farmer only.
After getting the trades, it will inject in to the villager trade event provided by forge (exactly how other mods do it), the only difference is you can create the trade exactly how you want it.
The mod will perform a check on each trade to make sure they are valid. If there are any problems it will then report this on the console.
The file must be built as specified below. I have made an example file if you are unsure how to make it.
Features
A fully customizable trade creation system where you can define basic or advanced trades using JSON.
Modify trades for any profession using a simple named config file (including the nitwit).
You can set "global" trades, these will be applied to any villager that can trade (call the config file "all.json")
Trades can be applied based on level.
All aspects of the trade can be modified (trade experience, discounts, etc.)
Enchantments can be applied to any trade item. This allows for whacky unique items that can't be acquired via normal (vanilla) means.
Modded item and block support.
Modded profession support – you can add trades to other people's villagers.
Remove all vanilla trades – you can do this per-profession.
List of vanilla professions (this is what the files should be named):
all.json
armorer.json
cartographer.json
cleric.json
farmer.json
fisherman.json
fletcher.json
leatherworker.json
librarian.json
mason.json
nitwit.json
shepherd.json
toolsmith.json
weaponsmith.json
Currently, there is no way for you to edit the wandering trader's trades. I am working on that.
Warnings:
Note that this mod does not give you the option to create trades for villagers who have no profession/unemployed.
Your trade is not guaranteed to appear every time – this is because of the trade pools. You can however remove vanilla trades.
If you are unsure what the item ID is, press f3+h ingame to enable tooltips and hover over the item you want to add.
If you have any problems launching the game with a custom config, please first start the game without a config and see if it goes to the title screen. If it does then your config is not formatted correctly. There will also be an error message in the console/log if it is caused by custom villager trades.
If you remove a trade that a villager already has, the villager will still keep that trade because it is stored in the NBT.
Config Files
For each profession, you can specify custom trades. Some fields are required and others are not. Here is an example: Example villager trade – Pastebin.com
Required fields:
- profession – This MUST be defined only once, it must not be nested inside of any objects.
- removeOtherTrades – This will remove other trades for this profession (works with vanilla).
- trades – This is an array of objects, each object defines a trade.
- trades / offer – REQUIRED for each trade definition. See "Trade Object" below.
- trades / request – REQUIRED for each trade definition. See "Trade Object" below.
- trades / additionalRequest – OPTIONAL. See "Trade Object".
- trades / tradeExp – REQUIRED, how much experience does the villager get for this trade (this experience is for the villager to go to the next trade level). I suggest not going below 1.
- trades / maxUses – REQUIRED
- trades / priceMultiplier – REQUIRED
- trades / demand – REQUIRED
- trades / tradeLevel – REQUIRED, at what level does this trade become available? The range is 1-5 where 1 is lowest.
Trade Object:
The below are requirements for each item defined within each 'trade object' instance.
- / itemKey – REQUIRED
- / amount – REQUIRED
- / enchantments – OPTIONAL, An object array of enchantments that can be applied, see "enchantment object" below.
- / metadata – OPTIONAL
Enchantment Object:
- / enchantmentKey – REQUIRED, this must be the key of the enchantment, example – minecraft:sharpness or minecraft:swiftness
- / enchantmentLevel – REQUIRED
You can find existing vanilla trades to use as a guide here: https:\\minecraft.fandom.com\wiki\Trading#Java_Edition
Help! My trade isn't appearing!
If your config entry is not created properly, the mod will throw a warning explaining what is wrong with that entry. It will then try to add the rest of the trades. This is an example of what you would see if there is a problem:
[14:26:03] [Worker-Main-9/INFO] [customvillagertrades/]: Checking custom villager trades…
[14:26:03] [Worker-Main-9/WARN] [customvillagertrades/]: Unable to add a custom trade! Reason: item/block does not exist – dotcoinmod:ironcoin
[14:26:03] [Worker-Main-9/INFO] [customvillagertrades/]: Check complete!
If you don't know the JSON language, please take the time to learn it before coming to me with problems – it is an easy language to learn, read and understand.
Do feel free to share your custom trades in the comments!
This mod works really well with my other mod: Dot Coin Mod – MinecraftPatch!
Add a comment