Class Enchantment

    • Field Detail

      • random

        protected final Random random
        random object built into enchantment class so you don't have to initialize your own
    • Method Detail

      • getName

        public String getName()
        Returns the name of the enchantment
        Returns:
        name of the enchantment
      • getMaxLevel

        public int getMaxLevel()
        Returns the maximum level of the enchantment
        Returns:
        maximum level of the enchantment
      • getTier

        public EnchantmentTier getTier()
        Returns the tier of the enchantment
        Returns:
        tier of the enchantment
      • getTrigger

        public EnchantmentTrigger getTrigger()
        Returns the trigger of the enchantment
        Returns:
        trigger of the enchantment
      • getDescription

        public List<String> getDescription()
        Returns a copy of the description of this enchantment
        Returns:
        a copy of the description of this enchantment
      • applicableTo

        public abstract String applicableTo()
        Returns a string that describes what types of items the enchantment can be applied to (e.g. "weapons and tools")
        Returns:
        a string that describes what types of items the enchantment can be applied to
      • canEnchant

        public abstract boolean canEnchant​(ItemStack item)
        Returns a boolean that is true when an item can be enchanted, false when the item cannot be
        Parameters:
        item - the item you wish to check
        Returns:
        a boolean that is true when an item can be enchanted, false when the item cannot be
      • effect

        public abstract void effect​(Event event,
                                    ActiveEnchantment enchantment)
        Effect that the enchantment gives
        Parameters:
        event - the bukkit event that was fired for this effect
        enchantment - the active enchantment that triggered this method