Majrusz Library

Majrusz Library

19M Downloads

CustomEnchantment logic terminates proper enchantability check logic flow

lcy0x1 opened this issue ยท 0 comments

commented

public boolean canEnchant( ItemStack itemStack ) {

Enchantments show allow items to override enchantability check, allowing other mod items to use your enchantments. But your custom enchantment does not allow that, causing compatibility issues.

The proper enchantability logic flow is:

  • Enchantment check if they can accept the item (as exception to EnchantmentCategory check)
  • Item check if they can accept the enchantment (as exception to EnchantmentCategory check)
  • fallback to EnchantmentCategory check
Screen Shot 2024-05-06 at 10 50 10