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

I have added a few equivalent to emerald gems (ruby & sapphire) and would like to add them as replacements in trades or possibly allow any of the gems to be accepted in in any given trade. i have searched merchantrecipe, merchantrecipelist, an any othe rclas involving villager trades to no avail.

i've only looked into this a few times, but i think cpw.mods.fml.common.registry.VillagerRegistry might have what you need

  • Author

Thank you for this, I have found the method that I have been searching for

void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)

Unfortunately, I have no idea how to use such method, but it seems that i can only add new stuff for emeralds to buy and sell

Thank you for this, I have found the method that I have been searching for

void manipulateTradesForVillager(EntityVillager villager, MerchantRecipeList recipeList, Random random)

Unfortunately, I have no idea how to use such method, but it seems that i can only add new stuff for emeralds to buy and sell

 

seems like you have to register your own IVillageTradeHandler via registerVillageTradeHandler. then you'd be able to manipulate the merchantrecipelist through it. although i'm not exactly sure what the limits to what you can do with it are (sorry, man, not really in the mood to dig around code right now) so you'll have to see for yourself

  • Author

ok so i have the trades working but i cant find the list of all the trades, which i need to properly give an equal chance that my mod trades appear along with the vanilla trades

  • Author

Or can i make it so that only my trades appear, completely overwriting the vanilla trades.

the trades are in EntityVillager.addDefaultEquipmentAndRecipies. that's also where VillagerRegistry.manageVillagerTrades is called. i think you can remove the vanilla trades through your IVillageTradeHandler

  • Author

ok i got the trade list thank you but how do i edit it to accept my gems alongside emeralds since there is nothing saying that it takes emeralds for what is being traded

there is nothing saying that it takes emeralds for what is being traded

 

there is. look harder. it's really not that difficult to find considering it's in the same class. anyway, create a new MerchantRecipe (you can specify the buy/sell items in the constructor) then add it to the provided merchant recipe list. although i don't think you can remove the villager's default trades through an IVillageTradeHandler because they're only added after mod trades are added

Guest
This topic is now closed to further replies.

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.