Minecraft Data Packs / Tool

Custom Villager Trades: Customize your villagers! (Modders tool)

  • check_circle Functions
  • check_circle Loot Tables
  • 17,805 views, 19 today
  • 2,949 downloads, 2 today
  • 25
  • 17
  • 12
BlockyGoddess's Avatar BlockyGoddess
Level 30 : Artisan Princess
6
Quick fixes and reupload (1.01): Details in log.

A lovely modders tool! Works from 1.14 to 1.17+

You can:
  • Change the default trades to any setup you'd like.
  • Keep the default trades and add extra ones.
  • Add many more trades per level if you want to be crazy. Have your villager get 10 trades? Possible!
  • Set your villagers to not be able to change profession.

I have tested this on multiple versions, they should all work flawlessly. Though the pack.mcmeta is set to 7, I tried it with 7 on 1.14 and it works fine.

While I have tested it, there might be issues. Please let me know if you run across any issues.
Make sure to back up your world! :)

Issues I have found: On 1.14 and 1.15 I noticed some problems with villagers existing before the datapack was installed. Getting their trades wiped but no new trades added. Didn't see this on 1.16+, but I've not done extensive testing!

Note: This is a bare-bones pack. You will need to change all the files yourself. There's no easy configuration file, sadly. Can be a lot of work, but for modders that want to customize it's very helpful! There's some readmes in the zip file.

Note 2: I will add professions from other mods once/if I get permission from their creators!

Any questions? Suggestions? Any feedback is welcome!
On additional options, clarification, bug reports, praise, all is good.

You're 100% free to use it in your own modpack, but please do credit me. :)
CompatibilityMinecraft 1.14
toMinecraft 1.18
Tags

1 Update Logs

Update #1 : by BlockyGoddess 08/14/2021 2:04:17 amAug 14th, 2021

Mistake 1:
Realized "scoreboard players reset @e" would also wipe scoreboards not added by me.
If you have not altered the files to your liking yet, you can simply replace the whole package.

If you have started to alter the files, you can replace the "scoreboard players reset @e" with "
execute @s run function cv:removescores" at the end of each tradechange file.
After that, add the included removescores.mcfunction and you're set.

Made that part more modular for any possible future changes in the score adjusting. Better to alter 1 file than dozens.

Mistake 2:
Put the tradechange files into a default folder, to add other folders for mods in the future.
Forgot to change the profession selector files.
Simply replace the 5 professionselect mcfunctions with the ones included in 1.01 and you're set!

Create an account or sign in to comment.

1
10/09/2021 11:34 pmhistory
Level 1 : New Miner
SuperGeniusZeb
SuperGeniusZeb's Avatar
I found a bug in 1.01 that causes the entire data pack to not work. The following line appears multiple times, but it is invalid syntax. You can't do "execute @s", you have to do "execute as @s" or something like that.


execute @s run function cv:removescores

In fact, the entire usage of the execute command is redundant here. You can just use the function command directly:

function cv:removescores

I also noticed several places with redundant execute usage. For example, the following:

execute as @e[type=minecraft:villager,tag=!check1,nbt={VillagerData:{profession:"minecraft:butcher", level:1}},limit=1,sort=nearest] run data remove entity @e[type=minecraft:villager,tag=!check1,nbt={VillagerData:{profession:"minecraft:butcher", level:1}},limit=1,sort=nearest] Offers.Recipes[-1]
...could be simplified to:

data remove entity @e[type=minecraft:villager,tag=!check1,nbt={VillagerData:{profession:"minecraft:butcher", level:1}},limit=1,sort=nearest] Offers.Recipes[-1]

Another example:

execute as @e[type=minecraft:villager,tag=!check1,nbt={VillagerData:{profession:"minecraft:butcher", level:1}},limit=1,sort=nearest] run tag @s add check1
could be simplified to:

tag @e[type=minecraft:villager,tag=!check1,nbt={VillagerData:{profession:"minecraft:butcher", level:1}},limit=1,sort=nearest] add check1
It's also worth noting that 1.18 makes the loot table "type" field required, so you'll want to update your loot tables to set a type. I think "minecraft:empty" is the appropriate one.

Hope this helps!



EDIT: I just realized that this whole data pack could be drastically simplified and optimized if you used the "@s" selector more. That way, you could reduce the number of times you iterate over the entities in the world and clean up a lot of clutter. If you want, I could send you a modified version of your data pack with all the changes I'm suggesting.
1
09/21/2021 11:08 pm
Level 1 : New Miner
Arrows_Of_Doom2
Arrows_Of_Doom2's Avatar
Just wondering if it would be difficult to add a setting where you can make the villagers damage proof, frozen in place, and silent, to make shops.
1
08/23/2021 8:06 pm
Level 1 : New Miner
BlindJak
BlindJak's Avatar
I have question?

how should the loot table folder look when finished? (do i need to delete left over templates? is max always the same or scaling down?

im just a bit unsure never dealt with villager trades or loot tables or anything like that
1
08/23/2021 10:57 pm
Level 30 : Artisan Princess
BlockyGoddess
BlockyGoddess's Avatar
There's nothing that needs to be deleted, only files that need altering.

Maxuses? You can set this per trade. It simply sets how many of that trade you can make between villager restocks.

I'm working on a bit of an overhaul together with a google sheets generator. I'll likely be uploading it in a few days. Should work out all the current flaws in the system as well as make it easier for users to setup the trade system.
1
08/24/2021 7:13 amhistory
Level 1 : New Miner
BlindJak
BlindJak's Avatar
thank you was just running into errors but i think i was filling in the .json files wrong

im trying to add abiut 150 trades
1
08/20/2021 7:10 am
Level 1 : New Miner
Ssafht
Ssafht's Avatar
it not working the fille is error how to works
2
08/20/2021 10:27 am
Level 30 : Artisan Princess
BlockyGoddess
BlockyGoddess's Avatar
It is a base pack. You need to manually go through the files and setup the trades.

So, unzip the zip file. The created folder should be modname/data.

In my next update I'll be adding a Google sheets to help create the trades. But it's still a lot of manual work. No ingame methods.
1
08/17/2021 3:02 am
Level 30 : Artisan Princess
BlockyGoddess
BlockyGoddess's Avatar
Note: If you set your villagers to be able to reroll, and reroll them, they'll reroll vanilla trades (just for first level)

This is an oversight of mine I'll fix in the next version.
1
08/15/2021 6:48 am
Level 1 : New Miner
datapacke
datapacke's Avatar
How to setup the trades?
1
08/15/2021 7:31 am
Level 30 : Artisan Princess
BlockyGoddess
BlockyGoddess's Avatar
Hello,

I explained it in the readme files. Check the tradefile example(explains layout) and trade example(explains how to set up individual trades) for information on how to do this. They're located in the zip file.
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome