HaMagil3 Posted September 1, 2020 Posted September 1, 2020 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😀 Quote
Recommended Posts
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.