Package org.bukkit.enchantments
Class EnchantmentWrapper
java.lang.Object
org.bukkit.enchantments.Enchantment
org.bukkit.enchantments.EnchantmentWrapper
public class EnchantmentWrapper extends Enchantment
A simple wrapper for ease of selecting
Enchantments-
Field Summary
Fields inherited from class org.bukkit.enchantments.Enchantment
ARROW_DAMAGE, ARROW_FIRE, ARROW_INFINITE, ARROW_KNOCKBACK, DAMAGE_ALL, DAMAGE_ARTHROPODS, DAMAGE_UNDEAD, DEPTH_STRIDER, DIG_SPEED, DURABILITY, FIRE_ASPECT, KNOCKBACK, LOOT_BONUS_BLOCKS, LOOT_BONUS_MOBS, LUCK, LURE, OXYGEN, PROTECTION_ENVIRONMENTAL, PROTECTION_EXPLOSIONS, PROTECTION_FALL, PROTECTION_FIRE, PROTECTION_PROJECTILE, SILK_TOUCH, THORNS, WATER_WORKER -
Constructor Summary
Constructors Constructor Description EnchantmentWrapper(int id) -
Method Summary
Modifier and Type Method Description booleancanEnchantItem(ItemStack item)Checks if this Enchantment may be applied to the givenItemStack.booleanconflictsWith(Enchantment other)Check if this enchantment conflicts with another enchantment.EnchantmentgetEnchantment()Gets the enchantment bound to this wrapperEnchantmentTargetgetItemTarget()Gets the type ofItemStackthat may fit this Enchantment.intgetMaxLevel()Gets the maximum level that this Enchantment may become.java.lang.StringgetName()Gets the unique name of this enchantmentintgetStartLevel()Gets the level that this Enchantment should start atMethods inherited from class org.bukkit.enchantments.Enchantment
equals, getById, getByName, getId, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
-
Constructor Details
-
EnchantmentWrapper
public EnchantmentWrapper(int id)
-
-
Method Details
-
getEnchantment
Gets the enchantment bound to this wrapper- Returns:
- Enchantment
-
getMaxLevel
public int getMaxLevel()Description copied from class:EnchantmentGets the maximum level that this Enchantment may become.- Specified by:
getMaxLevelin classEnchantment- Returns:
- Maximum level of the Enchantment
-
getStartLevel
public int getStartLevel()Description copied from class:EnchantmentGets the level that this Enchantment should start at- Specified by:
getStartLevelin classEnchantment- Returns:
- Starting level of the Enchantment
-
getItemTarget
Description copied from class:EnchantmentGets the type ofItemStackthat may fit this Enchantment.- Specified by:
getItemTargetin classEnchantment- Returns:
- Target type of the Enchantment
-
canEnchantItem
Description copied from class:EnchantmentChecks if this Enchantment may be applied to the givenItemStack.This does not check if it conflicts with any enchantments already applied to the item.
- Specified by:
canEnchantItemin classEnchantment- Parameters:
item- Item to test- Returns:
- True if the enchantment may be applied, otherwise False
-
getName
public java.lang.String getName()Description copied from class:EnchantmentGets the unique name of this enchantment- Specified by:
getNamein classEnchantment- Returns:
- Unique name
-
conflictsWith
Description copied from class:EnchantmentCheck if this enchantment conflicts with another enchantment.- Specified by:
conflictsWithin classEnchantment- Parameters:
other- The enchantment to check against- Returns:
- True if there is a conflict.
-