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 am making a mob with a trading system like a villager. It has all different attributes and textures and particles and sounds, but it still has the same trading as a villager. I want to only use my custom trades (which I have in the list already) but to remove the other recipes. I already deleted them in my file, but since I am extending EntityVillager (I think this is why) they still have the same recipes in game as a normal villager. How would I remove the trades from my "Villager" and add my new trades?

Best way would be to not extend EntityVillager, but implement all the trading stuff yourself; otherwise, I suppose you could override updateAITick and getRecipes, both of which end up calling the private method addDefaultEquipmentAndRecipies which is where the villager's trades are determined.

 

Another option would be to utilize VillagerRegistry.manageVillagerTrades to manage trades for a custom villager type (i.e. not any of the vanilla profession IDs) - you could totally clear the passed in List and add whatever you wanted.

  • Author

Best way would be to not extend EntityVillager, but implement all the trading stuff yourself; otherwise, I suppose you could override updateAITick and getRecipes, both of which end up calling the private method addDefaultEquipmentAndRecipies which is where the villager's trades are determined.

 

Another option would be to utilize VillagerRegistry.manageVillagerTrades to manage trades for a custom villager type (i.e. not any of the vanilla profession IDs) - you could totally clear the passed in List and add whatever you wanted.

 

Thank you soooo much! I used the method of overriding updateAITick and getRecipes! :)

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.