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.

HutchCS

Members
  • Joined

  • Last visited

  1. I posted a topic a few days ago regarding getting new villager trades, and I was able to generate new trades for the Villager by copying the old VillagerData into a new VillagerData variable and setting the villager i am interacting with to have the new VillagerData variable. However I am not able to update the Trading GUI as it will still have the old trades rather than the new ones. I know that it is generating new trades because I was able to print out the offers costs and results before and after they were swapped and they were different items.
  2. I didnt end up using the access transformer as I wasn't able to find the proper srg name for the updateTrades method even though i copied the same one used https://github.com/Favouriteless/SeasonalVillagers/blob/main/src/main/resources/META-INF/accesstransformer.cfg in this mod, but whatever. I was however able to get new trades through copying the old villager data into a new villagerdata variable, this will give me new trades (tested using println, I can see the result and costA and costB are different), but it wont update in the Villager GUI
  3. Hello all, I am trying to make a villager refresh mod, it is supposed to be able to refresh the most recent trade if it has not been traded with at that level. I am able to refresh the trades at level 1 by simply setting them as null and they auto regenerate, but for the later levels, that does not suffice, I was able to separate the MerchantOffers at the new trade (meaning if level three, it has the 4 trades from level 1 and 2 as one MerchantOffers, but the level 3 trades are a separate MerchantOffers). I have not been able to successfully regenerate new trades to replace for that final level. Any ideas?
  4. Hi, I'm trying to make a mod in which when you do some action (havent decided yet) it will refresh the current merchant trades into other basic merchant trades (Rather than break the workstation and replace it, I would rather just be able to hit a button/interact with specific item and the trades would refresh). This is what I have so far, @SubscribeEvent public static void villagerRefresh(EntityInteractSpecific event) { LivingEntity targetEntity = (LivingEntity) event.getTarget(); PlayerEntity playerEntity = event.getPlayer(); if (targetEntity instanceof VillagerEntity) { VillagerEntity villagerEntity = (VillagerEntity) targetEntity; MerchantOffers offers = villagerEntity.getOffers(); MerchantOffers newOffers = new MerchantOffers(offers.write()); if (playerEntity.getHeldItem(event.getHand()).getItem() == Items.STICK.getItem()) { VillagerEntity.setOffers(newOffers); } } } With some testing I can confirm that it does enter the second if statement, but I can't actually set the new trades. Any help would be greatly appreciated

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.