Class EnchantmentDamage

java.lang.Object
cn.nukkit.item.enchantment.Enchantment
cn.nukkit.item.enchantment.damage.EnchantmentDamage
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
EnchantmentDamageAll, EnchantmentDamageArthropods, EnchantmentDamageSmite

public abstract class EnchantmentDamage extends Enchantment
Author:
MagicDroidX (Nukkit Project)
  • Field Details

  • Constructor Details

  • Method Details

    • checkCompatibility

      public boolean checkCompatibility(Enchantment enchantment)
      Description copied from class: Enchantment
      Checks if this enchantment can be applied to an item that have the give enchantment without doing reverse check.
      Overrides:
      checkCompatibility in class Enchantment
      Parameters:
      enchantment - The enchantment to be checked
      Returns:
      If this enchantment is compatible with the other enchantment.
    • canEnchant

      public boolean canEnchant(Item item)
      Description copied from class: Enchantment
      Checks if the given item have a type which is compatible with this enchantment. This method does not check if the item already have incompatible enchantments.
      Overrides:
      canEnchant in class Enchantment
      Parameters:
      item - The item to be checked
      Returns:
      If the type of the item is valid for this enchantment
    • getMaxLevel

      public int getMaxLevel()
      Description copied from class: Enchantment
      The maximum safe level which is possible with this enchantment.
      Overrides:
      getMaxLevel in class Enchantment
    • getName

      public String getName()
      Overrides:
      getName in class Enchantment
    • isMajor

      public boolean isMajor()
      Overrides:
      isMajor in class Enchantment
    • isItemAcceptable

      @PowerNukkitOnly public boolean isItemAcceptable(Item item)
      Description copied from class: Enchantment
      Checks if an item can have this enchantment. It's not strict to the enchantment table.
      Overrides:
      isItemAcceptable in class Enchantment