Enum Class EnchantmentTag
- All Implemented Interfaces:
Serializable, Comparable<EnchantmentTag>, Constable
Minecraft enchantment tags with associated ID.
Take in count Mojang discontinued IDs since MC 1.14, any ID for new enchantments is not official.
Take in count Mojang discontinued IDs since MC 1.14, any ID for new enchantments is not official.
-
Nested Class Summary
Nested classes/interfaces inherited from class Enum
Enum.EnumDesc<E> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescription -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final EnchantmentTag[]Cached values ofvalues()including only pre 1.13 enchantments.static final EnchantmentTag[]Cached values ofvalues()including only server version compatible enchantments.static final StringCurrent key where stored enchantments are inside items tag.static final StringCurrent key where enchantments are inside items tag.static final EnchantmentTag[]Cached values ofvalues(). -
Method Summary
Modifier and TypeMethodDescriptionbooleanCheck if the current EnchantmentTag correspond to name object.booleancompareKey(Object key) Check if the current EnchantmentTag correspond to key object.String[]Get current enchant aliases.Get current enchant asEnchantment.static StringgetEnchantmentKey(ItemStack item) Get the current key where enchantments are stored in the item tag depending on item meta or server version.shortgetId()Get enchant numeric ID.getKey()Get current enchant key depending on current Bukkit version.@NotNull com.saicone.rtag.util.MCGet the minimum compatible version for this enchantment.intDeprecated, for removal: This API element is subject to removal in a future version.static EnchantmentTagGet the EnchantmentTag of provided name, short id orEnchantment.static ObjectParse the current object name into the most convenient format for EnchantmentTag.static EnchantmentTagReturns the enum constant of this class with the specified name.static EnchantmentTag[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
AQUA_AFFINITY
-
BANE_OF_ARTHROPODS
-
BINDING_CURSE
-
BLAST_PROTECTION
-
CHANNELING
-
DEPTH_STRIDER
-
EFFICIENCY
-
FEATHER_FALLING
-
FIRE_ASPECT
-
FIRE_PROTECTION
-
FLAME
-
FORTUNE
-
FROST_WALKER
-
IMPALING
-
INFINITY
-
KNOCKBACK
-
LOOTING
-
LOYALTY
-
LUCK_OF_THE_SEA
-
LURE
-
MENDING
-
MULTISHOT
-
PIERCING
-
POWER
-
PROJECTILE_PROTECTION
-
PROTECTION
-
PUNCH
-
QUICK_CHARGE
-
RESPIRATION
-
RIPTIDE
-
SHARPNESS
-
SILK_TOUCH
-
SMITE
-
SOUL_SPEED
-
SWEEPING
-
SWIFT_SNEAK
-
THORNS
-
UNBREAKING
-
VANISHING_CURSE
-
DENSITY
-
BREACH
-
WIND_BURST
-
LUNGE
-
-
Field Details
-
VALUES
Cached values ofvalues(). -
LEGACY_VALUES
Cached values ofvalues()including only pre 1.13 enchantments. -
SERVER_VALUES
Cached values ofvalues()including only server version compatible enchantments. -
TAG_KEY
Current key where enchantments are inside items tag. -
STORED_KEY
Current key where stored enchantments are inside items tag.- See Also:
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
getMinimumVersion
-
getId
public short getId()Get enchant numeric ID.- Returns:
- A number representing the enchantment.
-
getAliases
Get current enchant aliases.- Returns:
- A string array with enchant aliases.
-
getEnchantment
Get current enchant asEnchantment.- Returns:
- A Bukkit enchantment if exist on the current version, null otherwise.
-
getKey
Get current enchant key depending on current Bukkit version.- Returns:
- Short id for legacy versions, namespaced key otherwise.
-
compare
Check if the current EnchantmentTag correspond to name object.- Parameters:
name- Enchantment name, alias or short id.- Returns:
- true if the EnchantmentTag is assigned to name object.
-
compareKey
Check if the current EnchantmentTag correspond to key object.- Parameters:
key- Namespaced key or short id.- Returns:
- true if the EnchantmentTag is assigned to key object.
-
parseName
-
getEnchantmentKey
-
of
Get the EnchantmentTag of provided name, short id orEnchantment.- Parameters:
name- Enchantment name, alias or short id.- Returns:
- The EnchantmentTag assigned to key object, null if not exist.
-
getVersion
Deprecated, for removal: This API element is subject to removal in a future version.Get added version for this enchant.- Returns:
- A server version number.
-