crwdns130447:0crwdne130447:0

crwdns130449:0:javadoc:crwdnd130449:0:javadoc:crwdnd130449:0:javadoc:crwdne130449:0

crwdns130451:0crwdne130451:0

crwdns130453:0crwdne130453:0

crwdns130455:0:javadoc:crwdne130455:0

crwdns130457:0crwdne130457:0

crwdns130459:0crwdne130459:0

  • crwdns130461:0:javadoc:crwdne130461:0

  • crwdns130463:0crwdne130463:0

  • crwdns130465:0crwdne130465:0

  • crwdns130467:0crwdne130467:0

  • crwdns130469:0crwdne130469:0

  • crwdns130471:0crwdne130471:0

crwdns130473:0:javadoc:crwdne130473:0

crwdns130475:0crwdne130475:0

crwdns130477:0crwdne130477:0

crwdns130479:0crwdne130479:0

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

crwdns130481:0crwdne130481:0

crwdns130483:0:javadoc:crwdnd130483:0:javadoc:crwdne130483:0

Note

crwdns130485:0crwdne130485:0

crwdns130487:0crwdne130487:0

crwdns130489:0crwdne130489: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();

crwdns130491:0crwdne130491:0

  • crwdns130493:0crwdne130493:0

  • crwdns130495:0crwdne130495:0

  • crwdns130497:0crwdne130497:0

  • crwdns130499:0crwdne130499:0

crwdns130501:0crwdne130501:0

Note

crwdns130503:0crwdne130503:0

crwdns130505:0crwdne130505:0

crwdns130507:0:javadoc:crwdne130507: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);

crwdns130509:0crwdne130509:0

Note

crwdns130511:0crwdne130511:0