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 Type
    Method
    Description
    boolean
    canEnchantItem(org.bukkit.inventory.ItemStack item)
     
    boolean
    canEnchantPrimary(org.bukkit.inventory.ItemStack item)
    If this enchantment can be applied to this item using an enchantment table.
    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.
    boolean
    conflictsWith(org.bukkit.enchantments.Enchantment other)
     
    @NotNull net.kyori.adventure.text.Component
    displayName(int i)
     
    @NotNull Set<org.bukkit.inventory.EquipmentSlot>
     
    static org.bukkit.enchantments.Enchantment
     
    float
    getDamageIncrease(int i, @NotNull org.bukkit.entity.EntityCategory entityCategory)
     
    int
     
    org.bukkit.enchantments.EnchantmentTarget
     
    int
     
     
    io.papermc.paper.enchantments.EnchantmentRarity
    Represents the rarity of obtaining an enchantment.
    int
     
    static List<String>
     
    int
    The rarity of the enchantment, kept for compatibility with Bukkit.
    boolean
     
    boolean
     
    boolean
    isInRange(int level, int modifier)
     
    boolean
     
    boolean
    Treasure enchantments can only be obtained from chest loot, fishing, or trading for enchanted books.
    static org.bukkit.enchantments.Enchantment
    parseEnchantment(String enchantmentName)
    Parses a PotionEffect id or name if possible.
    static void
    Register all enchantment types with Enchantment.

    Methods inherited from class org.bukkit.enchantments.Enchantment

    equals, getByKey, getByName, getKey, hashCode, isAcceptingRegistrations, registerEnchantment, stopAcceptingRegistrations, toString, values

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Method Details

    • register

      public static void register()
      Register all enchantment types with Enchantment.
    • getVanillaIds

      public static List<String> getVanillaIds()
    • parseEnchantment

      public static org.bukkit.enchantments.Enchantment parseEnchantment(String enchantmentName)
      Parses a PotionEffect id or name if possible.
      Parameters:
      enchantmentName - The Enchantment name.
      Returns:
      The associated Enchantment, or null.
    • getByVanillaId

      public static org.bukkit.enchantments.Enchantment getByVanillaId(String vanillaId)
    • getName

      public String getName()
      Specified by:
      getName in class org.bukkit.enchantments.Enchantment
    • getId

      public int getId()
    • getMaxLevel

      public int getMaxLevel()
      Specified by:
      getMaxLevel in class org.bukkit.enchantments.Enchantment
    • getStartLevel

      public int getStartLevel()
      Specified by:
      getStartLevel in class org.bukkit.enchantments.Enchantment
    • getItemTarget

      public org.bukkit.enchantments.EnchantmentTarget getItemTarget()
      Specified by:
      getItemTarget in class org.bukkit.enchantments.Enchantment
    • conflictsWith

      public boolean conflictsWith(org.bukkit.enchantments.Enchantment other)
      Specified by:
      conflictsWith in class org.bukkit.enchantments.Enchantment
    • canEnchantItem

      public boolean canEnchantItem(org.bukkit.inventory.ItemStack item)
      Specified by:
      canEnchantItem in class org.bukkit.enchantments.Enchantment
    • displayName

      @NotNull public @NotNull net.kyori.adventure.text.Component displayName(int i)
      Specified by:
      displayName in class org.bukkit.enchantments.Enchantment
    • isTradeable

      public boolean isTradeable()
      Specified by:
      isTradeable in class org.bukkit.enchantments.Enchantment
    • isDiscoverable

      public boolean isDiscoverable()
      Specified by:
      isDiscoverable in class org.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:
      getWeight in interface WeightedRandom.Choice
      See Also:
    • isTreasure

      public boolean isTreasure()
      Treasure enchantments can only be obtained from chest loot, fishing, or trading for enchanted books.
      Specified by:
      isTreasure in class org.bukkit.enchantments.Enchantment
      Returns:
      true if the enchantment is a treasure, otherwise false
    • isCursed

      public boolean isCursed()
      Specified by:
      isCursed in class org.bukkit.enchantments.Enchantment
    • getRarity

      public io.papermc.paper.enchantments.EnchantmentRarity getRarity()
      Represents the rarity of obtaining an enchantment.
      Specified by:
      getRarity in class org.bukkit.enchantments.Enchantment
      Returns:
      the rarity of the enchantment
    • getDamageIncrease

      public float getDamageIncrease(int i, @NotNull @NotNull org.bukkit.entity.EntityCategory entityCategory)
      Specified by:
      getDamageIncrease in class org.bukkit.enchantments.Enchantment
    • getActiveSlots

      @NotNull public @NotNull Set<org.bukkit.inventory.EquipmentSlot> getActiveSlots()
      Specified by:
      getActiveSlots in class org.bukkit.enchantments.Enchantment
    • isInRange

      public boolean isInRange(int level, int modifier)