Package net.glowstone.constants
Class GlowEnchantment
java.lang.Object
org.bukkit.enchantments.Enchantment
net.glowstone.constants.GlowEnchantment
- All Implemented Interfaces:
WeightedRandom.Choice,org.bukkit.Keyed
public final class GlowEnchantment
extends org.bukkit.enchantments.Enchantment
implements WeightedRandom.Choice
Definitions of enchantment types.
-
Field Summary
Fields inherited from class org.bukkit.enchantments.Enchantment
ARROW_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, THORNS, VANISHING_CURSE, WATER_WORKER -
Method Summary
Modifier and TypeMethodDescriptionbooleancanEnchantItem(org.bukkit.inventory.ItemStack item) booleancanEnchantPrimary(org.bukkit.inventory.ItemStack item) If this enchantment can be applied to this item using an enchantment table.booleancanEnchantSecondary(org.bukkit.inventory.ItemStack item) If this enchantment cannot be applied using an enchantment table but can be applied using an enchanted book and anvil.booleanconflictsWith(org.bukkit.enchantments.Enchantment other) @NotNull net.kyori.adventure.text.ComponentdisplayName(int i) @NotNull Set<org.bukkit.inventory.EquipmentSlot>static org.bukkit.enchantments.EnchantmentgetByVanillaId(String vanillaId) floatgetDamageIncrease(int i, @NotNull org.bukkit.entity.EntityCategory entityCategory) intgetId()org.bukkit.enchantments.EnchantmentTargetintgetName()io.papermc.paper.enchantments.EnchantmentRarityRepresents the rarity of obtaining an enchantment.intintThe rarity of the enchantment, kept for compatibility with Bukkit.booleanisCursed()booleanbooleanisInRange(int level, int modifier) booleanbooleanTreasure enchantments can only be obtained from chest loot, fishing, or trading for enchanted books.static org.bukkit.enchantments.EnchantmentparseEnchantment(String enchantmentName) Parses a PotionEffect id or name if possible.static voidregister()Register all enchantment types with Enchantment.Methods inherited from class org.bukkit.enchantments.Enchantment
equals, getByKey, getByName, getKey, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values
-
Method Details
-
register
public static void register()Register all enchantment types with Enchantment. -
getVanillaIds
-
parseEnchantment
Parses a PotionEffect id or name if possible.- Parameters:
enchantmentName- The Enchantment name.- Returns:
- The associated Enchantment, or null.
-
getByVanillaId
-
getName
- Specified by:
getNamein classorg.bukkit.enchantments.Enchantment
-
getId
public int getId() -
getMaxLevel
public int getMaxLevel()- Specified by:
getMaxLevelin classorg.bukkit.enchantments.Enchantment
-
getStartLevel
public int getStartLevel()- Specified by:
getStartLevelin classorg.bukkit.enchantments.Enchantment
-
getItemTarget
public org.bukkit.enchantments.EnchantmentTarget getItemTarget()- Specified by:
getItemTargetin classorg.bukkit.enchantments.Enchantment
-
conflictsWith
public boolean conflictsWith(org.bukkit.enchantments.Enchantment other) - Specified by:
conflictsWithin classorg.bukkit.enchantments.Enchantment
-
canEnchantItem
public boolean canEnchantItem(org.bukkit.inventory.ItemStack item) - Specified by:
canEnchantItemin classorg.bukkit.enchantments.Enchantment
-
displayName
@NotNull public @NotNull net.kyori.adventure.text.Component displayName(int i) - Specified by:
displayNamein classorg.bukkit.enchantments.Enchantment
-
isTradeable
public boolean isTradeable()- Specified by:
isTradeablein classorg.bukkit.enchantments.Enchantment
-
isDiscoverable
public boolean isDiscoverable()- Specified by:
isDiscoverablein classorg.bukkit.enchantments.Enchantment
-
canEnchantPrimary
public boolean canEnchantPrimary(org.bukkit.inventory.ItemStack item) If this enchantment can be applied to this item using an enchantment table.- Returns:
- If this item is a primary item for this enchantment
-
canEnchantSecondary
public boolean canEnchantSecondary(org.bukkit.inventory.ItemStack item) If this enchantment cannot be applied using an enchantment table but can be applied using an enchanted book and anvil.- Returns:
- If this item is a secondary item for this enchantment
-
getWeight
public int getWeight()The rarity of the enchantment, kept for compatibility with Bukkit.- Specified by:
getWeightin interfaceWeightedRandom.Choice- See Also:
-
isTreasure
public boolean isTreasure()Treasure enchantments can only be obtained from chest loot, fishing, or trading for enchanted books.- Specified by:
isTreasurein classorg.bukkit.enchantments.Enchantment- Returns:
- true if the enchantment is a treasure, otherwise false
-
isCursed
public boolean isCursed()- Specified by:
isCursedin classorg.bukkit.enchantments.Enchantment
-
getRarity
public io.papermc.paper.enchantments.EnchantmentRarity getRarity()Represents the rarity of obtaining an enchantment.- Specified by:
getRarityin classorg.bukkit.enchantments.Enchantment- Returns:
- the rarity of the enchantment
-
getDamageIncrease
public float getDamageIncrease(int i, @NotNull @NotNull org.bukkit.entity.EntityCategory entityCategory) - Specified by:
getDamageIncreasein classorg.bukkit.enchantments.Enchantment
-
getActiveSlots
- Specified by:
getActiveSlotsin classorg.bukkit.enchantments.Enchantment
-
isInRange
public boolean isInRange(int level, int modifier)
-