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 trying to make my own Villagers, following Samedifferent's More Villagers code, and it all works, except EmeraldForItemsTrade and ItemsForEmeraldsTrade are both private, so I cannot use them.

Is there a different method to use instead to give trades? This is the code that should, but doesn't work:

VillagerTrades.ITrade[] oceanographerLevel1 = new VillagerTrades.ITrade[]{
        new VillagerTrades.EmeraldForItemsTrade(Items.PRISMARINE,14,16,2),
        new VillagerTrades.ItemsForEmeraldsTrade(Items.SEA_LANTERN, 2, 4, 16, 1)
};
VillagerTrades.ITrade[] oceanographerLevel2 = new VillagerTrades.ITrade[]{
        new VillagerTrades.EmeraldForItemsTrade(Items.PRISMARINE_BRICKS,14,16,10),
        new VillagerTrades.ItemsForEmeraldsTrade(Items.SPONGE, 4, 2, 16, 5)
};
VillagerTrades.ITrade[] oceanographerLevel3 = new VillagerTrades.ITrade[]{
        new VillagerTrades.EmeraldForItemsTrade(Items.DARK_PRISMARINE,12,16,20),
        new VillagerTrades.EmeraldForMapTrade(13, Structure.BURIED_TREASURE, MapDecoration.Type.RED_X, 12, 10)
};
VillagerTrades.ITrade[] oceanographerLevel4 = new VillagerTrades.ITrade[]{
        new VillagerTrades.ItemsForEmeraldsTrade(Items.NAUTILUS_SHELL, 3, 1, 12, 15),
        new VillagerTrades.ItemsForEmeraldsTrade(Items.HEART_OF_THE_SEA, 8, 1, 12, 15),
};
VillagerTrades.ITrade[] oceanographerLevel5 = new VillagerTrades.ITrade[]{
        new VillagerTrades.ItemsForEmeraldsTrade(Items.TRIDENT, 32, 1, 2, 30)
};
VillagerTrades.TRADES.put(OCEANOGRAPHER.get(),toIntMap(ImmutableMap.of(1,oceanographerLevel1,2,oceanographerLevel2,3,oceanographerLevel3,4,oceanographerLevel4,5,oceanographerLevel5)));

 

copy them and create your own classes for these trades, since they do not contain any relevant data there is no reason to use exactly these two classes

  • 3 weeks later...
8 hours ago, MinerMinerMods said:

Is the plugin XEcon?

he mean this class

but you can use BasicItemListing (in 1.16 it's BasicTrade), for simple Trades

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.