crwdns139305:0crwdne139305:0

Warning

crwdns139307:0crwdne139307:0

crwdns139309:0:javadoc:crwdnd139309:0:javadoc:crwdnd139309:0:javadoc:crwdne139309:0

crwdns139311:0crwdne139311:0

crwdns139313:0crwdne139313:0

crwdns139315:0:javadoc:crwdne139315:0

crwdns139317:0crwdne139317:0

crwdns139319:0crwdne139319:0

  • crwdns139321:0:javadoc:crwdne139321:0

  • crwdns139323:0crwdne139323:0

  • crwdns139325:0crwdne139325:0

  • crwdns139327:0crwdne139327:0

  • crwdns139329:0crwdne139329:0

  • crwdns139331:0crwdne139331:0

crwdns139333:0:javadoc:crwdne139333:0

crwdns139335:0crwdne139335:0

crwdns139337:0crwdne139337:0

crwdns139339:0crwdne139339:0

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

crwdns139341:0crwdne139341:0

crwdns139343:0:javadoc:crwdnd139343:0:javadoc:crwdne139343:0

Note

crwdns139345:0crwdne139345:0

crwdns139347:0crwdne139347:0

crwdns139349:0crwdne139349: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();

crwdns139351:0crwdne139351:0

  • crwdns139353:0crwdne139353:0

  • crwdns139355:0crwdne139355:0

  • crwdns139357:0crwdne139357:0

  • crwdns139359:0crwdne139359:0

crwdns139361:0crwdne139361:0

Note

crwdns139363:0crwdne139363:0

crwdns139365:0crwdne139365:0

crwdns139367:0:javadoc:crwdne139367: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);

crwdns139369:0crwdne139369:0

Note

crwdns139371:0crwdne139371:0