Jump to content

HaMagil3

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by HaMagil3

  1. thank you i'll try
  2. ListNBT enchantmentList = ItemStack1.getEnchantmentTagList(); for (int i = 0; i < enchantmentList.size(); i++){ short id = enchantmentList.getCompound(i).getShort("id"); short lvl = enchantmentList.getCompound(i).getShort("lvl"); ItemStack2.addEnchantment(Objects.requireNonNull(Enchantment.getEnchantmentByID(id)), lvl); } I tried to kinda copy the enchnments from itemStack1 to itemStack2 in this code, the problem is that every enchantment in itemStack1 become protection in itemStack2. The other stuff works fine, the levels and the number of enchantments is good. Thanks😀
×
×
  • Create New...

Important Information

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