Jump to content

[1.14.4] Adding new trades to existing villagers?


Zathrox

Recommended Posts

Hello there, has anyone figured out how to easily add new trades to existing villager trades? Like add a new crop to the farmer trades for example? I can see the villager traders hashmaps/array, etc but i'm not quite sure how to go about adding to that list correctly and get it registered and noticed by vanilla?

 

if someone has the time to explain how to approach the problem I'd love to learn more about manipulating these so I can add new trades, that'd be amazing!

*edit* Another issue I have is when I sort of copy the code to another class just to play about with adding, alot of the VillagerTrades.class functions are locked and private and I know you can use merchant offer to make new trades but its not recognised as an ITrade array, just boggled and confused, so clarity would be nice! xD

 

Zathrox

Edited by Zathrox
  • Like 1
Link to comment
Share on other sites

Ah thanks for this! I basically got the trades working after finding the VillagerTradesEvent myself and between looking at that and other peoples examples for the wandering trader, I got it working buuuuut for the trades, I practically ripped and copied the VillagerTrades class and made it public so finding the BasicTrade class is very useful to know! I can pretty much scrap my own and use that!

 

Nevermind, will stick to my class, when they say basic trade, they really do mean basic! its good if you want to use emeralds to buy something like a sword or other items but not so much for 22 CustomCrop for emeralds, etc :P

Edited by Zathrox
  • Like 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.