Package org.bukkit.enchantments
Class EnchantmentWrapper
java.lang.Object
org.bukkit.enchantments.Enchantment
org.bukkit.enchantments.EnchantmentWrapper
- All Implemented Interfaces:
- net.kyori.adventure.key.Keyed,- Translatable,- Keyed
A simple wrapper for ease of selecting 
Enchantments- 
Field SummaryFields inherited from class org.bukkit.enchantments.EnchantmentARROW_DAMAGE, ARROW_FIRE, ARROW_INFINITE, ARROW_KNOCKBACK, BINDING_CURSE, CHANNELING, DAMAGE_ALL, DAMAGE_ARTHROPODS, DAMAGE_UNDEAD, DEPTH_STRIDER, DIG_SPEED, DURABILITY, FIRE_ASPECT, FROST_WALKER, IMPALING, KNOCKBACK, LOOT_BONUS_BLOCKS, LOOT_BONUS_MOBS, LOYALTY, LUCK, LURE, MENDING, MULTISHOT, OXYGEN, PIERCING, PROTECTION_ENVIRONMENTAL, PROTECTION_EXPLOSIONS, PROTECTION_FALL, PROTECTION_FIRE, PROTECTION_PROJECTILE, QUICK_CHARGE, RIPTIDE, SILK_TOUCH, SOUL_SPEED, SWEEPING_EDGE, SWIFT_SNEAK, THORNS, VANISHING_CURSE, WATER_WORKER
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionbooleancanEnchantItem(@NotNull ItemStack item) Checks if this Enchantment may be applied to the givenItemStack.booleanconflictsWith(@NotNull Enchantment other) Check if this enchantment conflicts with another enchantment.displayName(int level) Get the name of the enchantment with its applied level.Gets the equipment slots where this enchantment is considered "active".floatgetDamageIncrease(int level, EntityCategory entityCategory) Gets the damage increase as a result of the level and entity category specifiedGets the enchantment bound to this wrapperGets the type ofItemStackthat may fit this Enchantment.intGets the maximum level that this Enchantment may become.getName()Gets the unique name of this enchantmentGets the rarity of this enchantment.intGets the level that this Enchantment should start atbooleanisCursed()Checks if this enchantment is a cursed enchantment
 Cursed enchantments are found the same way treasure enchantments arebooleanChecks if this enchantment can be found in an enchanting table or use to enchant items generated by loot tables.booleanChecks if this enchantment can be found in villager trades.booleanChecks if this enchantment is a treasure enchantment.Gets the translation key.Methods inherited from class org.bukkit.enchantments.Enchantmentequals, getByKey, getByName, getKey, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
- 
Constructor Details- 
EnchantmentWrapper
 
- 
- 
Method Details- 
getEnchantmentGets the enchantment bound to this wrapper- Returns:
- Enchantment
 
- 
getMaxLevelpublic int getMaxLevel()Description copied from class:EnchantmentGets the maximum level that this Enchantment may become.- Specified by:
- getMaxLevelin class- Enchantment
- Returns:
- Maximum level of the Enchantment
 
- 
getStartLevelpublic int getStartLevel()Description copied from class:EnchantmentGets the level that this Enchantment should start at- Specified by:
- getStartLevelin class- Enchantment
- Returns:
- Starting level of the Enchantment
 
- 
getItemTargetDescription copied from class:EnchantmentGets the type ofItemStackthat may fit this Enchantment.- Specified by:
- getItemTargetin class- Enchantment
- Returns:
- Target type of the Enchantment
 
- 
canEnchantItemDescription 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 class- Enchantment
- Parameters:
- item- Item to test
- Returns:
- True if the enchantment may be applied, otherwise False
 
- 
getNameDescription copied from class:EnchantmentGets the unique name of this enchantment- Specified by:
- getNamein class- Enchantment
- Returns:
- Unique name
 
- 
isTreasurepublic boolean isTreasure()Description copied from class:EnchantmentChecks if this enchantment is a treasure enchantment.
 Treasure enchantments can only be received via looting, trading, or fishing.- Specified by:
- isTreasurein class- Enchantment
- Returns:
- true if the enchantment is a treasure enchantment
 
- 
isCursedpublic boolean isCursed()Description copied from class:EnchantmentChecks if this enchantment is a cursed enchantment
 Cursed enchantments are found the same way treasure enchantments are- Specified by:
- isCursedin class- Enchantment
- Returns:
- true if the enchantment is cursed
 
- 
conflictsWithDescription copied from class:EnchantmentCheck if this enchantment conflicts with another enchantment.- Specified by:
- conflictsWithin class- Enchantment
- Parameters:
- other- The enchantment to check against
- Returns:
- True if there is a conflict.
 
- 
displayNameDescription copied from class:EnchantmentGet the name of the enchantment with its applied level.If the given levelis either less than theEnchantment.getStartLevel()or greater than theEnchantment.getMaxLevel(), the level may not be shown in the numeral format one may otherwise expect.- Specified by:
- displayNamein class- Enchantment
- Parameters:
- level- the level of the enchantment to show
- Returns:
- the name of the enchantment with levelapplied
 
- 
translationKeyDescription copied from interface:net.kyori.adventure.translation.TranslatableGets the translation key.- Returns:
- the translation key
 
- 
isTradeablepublic boolean isTradeable()Description copied from class:EnchantmentChecks if this enchantment can be found in villager trades.- Specified by:
- isTradeablein class- Enchantment
- Returns:
- true if the enchantment can be found in trades
 
- 
isDiscoverablepublic boolean isDiscoverable()Description copied from class:EnchantmentChecks if this enchantment can be found in an enchanting table or use to enchant items generated by loot tables.- Specified by:
- isDiscoverablein class- Enchantment
- Returns:
- true if the enchantment can be found in a table or by loot tables
 
- 
getRarityDescription copied from class:EnchantmentGets the rarity of this enchantment.- Specified by:
- getRarityin class- Enchantment
- Returns:
- the rarity
 
- 
getDamageIncreaseDescription copied from class:EnchantmentGets the damage increase as a result of the level and entity category specified- Specified by:
- getDamageIncreasein class- Enchantment
- Parameters:
- level- the level of enchantment
- entityCategory- the category of entity
- Returns:
- the damage increase
 
- 
getActiveSlotsDescription copied from class:EnchantmentGets the equipment slots where this enchantment is considered "active".- Specified by:
- getActiveSlotsin class- Enchantment
- Returns:
- the equipment slots
 
 
-