1

HELP [1.20.1] Can't make a merchant recipe to return enchanted item/book

Farck's Avatar Farck8/8/23 12:44 pm
1 emeralds 97
Im trying to change some of the librarian, armorer, toolsmith and weaponsmith vanilla trades in order to avoid a source of infinite diamond gear, avoid the workstation rerolling for enchanted books and make enchanted books expencier.

Here is what im doing.



//level 4 clear -----------------------------------------------------------------------

if (event.getType() == VillagerProfession.ARMORER) {

Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades();

int villagerLevel = 4;

trades.get(villagerLevel).clear();

}

//level 4 add trade ----------------------------------------------------------------------

if (event.getType() == VillagerProfession.ARMORER) {

Int2ObjectMap<List<VillagerTrades.ItemListing>> trades = event.getTrades();

ItemStack stack = new ItemStack(Items.DIAMOND_LEGGINGS, 1);

int villagerLevel = 4;

trades.get(villagerLevel).add((pTrader, pRandom) -> new MerchantOffer(

new ItemStack(Items.EMERALD, 19),

new ItemStack(Items.DIAMOND, 5),

stack, 3, 50, 0.4f));

}



The problem is i couldn't figure out how to enchant the output item in the merchant recipe.

width=1000


width=1000





Here some examples of the goal (without the enchantments).

Posted by Farck's Avatar
Farck
Level 18 : Journeyman Skinner
6

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome