Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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

You might want to check the VillagerTradesEvent event and the BasicTrade class it refers to. Seems to be Forge devs indicating how you can do what you seem to want to do. There is even a WandererTradesEvent for the wandering trader as that is distinct from regular trading.

  • Author

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

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...

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.