how do i enchant items in trades with villagers?

Started by S3V7N on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2021
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
how do i enchant items in trades with villagers?

So i have this code:

trades.get(1).add(new BasicItemListing(new ItemStack(Items.EMERALD, 10),



                    new ItemStack(ExtraModModItems.COPPER_SWORD.get()), 12, 1, 0.2f));

and i want to enchant this copper sword how can i do it?