Class Enchantment
- java.lang.Object
-
- me.boboballoon.enhancedenchantments.enchantment.Enchantment
-
- Direct Known Subclasses:
ArmorEnchantment,BowEnchantment,FishingRodEnchantment,ItemEnchantment,UniversalEnchantment
public abstract class Enchantment extends Object
Superclass of any type of enchantment
-
-
Constructor Summary
Constructors Constructor Description Enchantment(String name, int maxLevel, EnchantmentTier tier, EnchantmentTrigger trigger, List<String> description)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract StringapplicableTo()Returns a string that describes what types of items the enchantment can be applied to (e.g.abstract booleancanEnchant(ItemStack item)Returns a boolean that is true when an item can be enchanted, false when the item cannot beabstract voideffect(Event event, ActiveEnchantment enchantment)Effect that the enchantment givesList<String>getDescription()Returns a copy of the description of this enchantmentintgetMaxLevel()Returns the maximum level of the enchantmentStringgetName()Returns the name of the enchantmentEnchantmentTiergetTier()Returns the tier of the enchantmentEnchantmentTriggergetTrigger()Returns the trigger of the enchantment
-
-
-
Field Detail
-
random
protected final Random random
random object built into enchantment class so you don't have to initialize your own
-
-
Constructor Detail
-
Enchantment
public Enchantment(String name, int maxLevel, EnchantmentTier tier, EnchantmentTrigger trigger, List<String> description)
-
-
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 effectenchantment- the active enchantment that triggered this method
-
-