Jump to content

[1.20.1] Problem creating merchant recipe to return enchanted item/book


Recommended Posts

Posted (edited)

Wrong forum, sorry for the trouble.

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.

 

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

image.pngimage.pngimage.pngimage.png

 

Edited by Farck
make topic in the wrong forum

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.