Posted November 24, 20213 yr 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)));
November 25, 20213 yr 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
November 27, 20213 yr Author I found a repository that manages to do these trades. In fact, the repository is yours, so extremely thank you!
December 18, 20213 yr 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.