Jump to content

Recommended Posts

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.

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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

Posted

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.

Announcements



×
×
  • Create New...

Important Information

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