crwdns119695:0crwdne119695:0

crwdns119697:0:javadoc:crwdnd119697:0:javadoc:crwdnd119697:0:javadoc:crwdne119697:0

crwdns119699:0crwdne119699:0

crwdns119701:0crwdne119701:0

crwdns119703:0:javadoc:crwdne119703:0

crwdns119705:0crwdne119705:0

crwdns119707:0crwdne119707:0

  • crwdns119709:0:javadoc:crwdne119709:0

  • crwdns119711:0crwdne119711:0

  • crwdns119713:0crwdne119713:0

  • crwdns119715:0crwdne119715:0

  • crwdns119717:0crwdne119717:0

  • crwdns119719:0crwdne119719:0

crwdns119721:0:javadoc:crwdne119721:0

crwdns119723:0crwdne119723:0

crwdns119725:0crwdne119725:0

crwdns119727:0crwdne119727:0

TradeOffer offer = TradeOffer.builder()
    .firstBuyingItem(ItemStack.of(ItemTypes.DIRT, 5))
    .sellingItem(ItemStack.of(ItemTypes.GRASS, 3))
    .uses(0)
    .maxUses(4)
    .canGrantExperience(false)
    .build();

crwdns119729:0crwdne119729:0

crwdns119731:0:javadoc:crwdnd119731:0:javadoc:crwdne119731:0

Note

crwdns119733:0crwdne119733:0

crwdns119735:0crwdne119735:0

crwdns119737:0crwdne119737:0

TradeOfferGenerator tradeOfferGenerator = TradeOfferGenerator.builder()
        .setPrimaryItemGenerator(random -> ItemStack.of(ItemTypes.DIRT, random.nextInt(3) + 5))
        .setSellingGenerator(random -> ItemStack.of(ItemTypes.GRASS, 5))
        .startingUses(VariableAmount.baseWithVariance(2, 1))
        .maxUses(VariableAmount.fixed(5))
        .experienceChance(0.5)
        .build();

crwdns119739:0crwdne119739:0

  • crwdns119741:0crwdne119741:0

  • crwdns119743:0crwdne119743:0

  • crwdns119745:0crwdne119745:0

  • crwdns119747:0crwdne119747:0

crwdns119749:0crwdne119749:0

Note

crwdns119751:0crwdne119751:0

crwdns119753:0crwdne119753:0

crwdns119755:0:javadoc:crwdne119755:0

VillagerRegistry villagerRegistry = this.game.getRegistry().getVillagerRegistry();
List<TradeOfferListMutator> generators = new ArrayList<>(villagerRegistry.getMutatorsForCareer(Careers.FARMER, 1));
generators.addAll(additionalFarmerLevel1TradeOffers());
villagerRegistry.setMutators(Careers.FARMER, 1, generators);

crwdns119757:0crwdne119757:0

Note

crwdns119759:0crwdne119759:0