Package com.cryptomorin.xseries
Class XEnchantment
java.lang.Object
com.cryptomorin.xseries.base.XModule<XEnchantment,org.bukkit.enchantments.Enchantment>
com.cryptomorin.xseries.XEnchantment
- All Implemented Interfaces:
XBase<XEnchantment,org.bukkit.enchantments.Enchantment>
Enchantment support with multiple aliases.
Uses some EssentialsX enchantment list for aliases.
Enchantment levels do not start from 0, they start from 1
EssentialsX Enchantment: https://github.com/Bukkit/Bukkit/blob/master/src/main/java/org/bukkit/enchantments/Enchantment.java Enchantment: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/enchantments/Enchantment.html Enchanting: https://minecraft.wiki/w/Enchanting
- Version:
- 3.0.0
- Author:
- Crypto Morin
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final Set<org.bukkit.entity.EntityType> Deprecated.static final Set<org.bukkit.entity.EntityType> Deprecated.static final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XRegistry<XEnchantment, org.bukkit.enchantments.Enchantment> static final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantmentstatic final XEnchantment[]Deprecated.UseREGISTRY->XRegistry.getValues()instead.static final XEnchantmentstatic final XEnchantment -
Method Summary
Modifier and TypeMethodDescription@NotNull org.bukkit.inventory.ItemStackgetBook(int level) Gets the enchanted book of this enchantment.@Nullable org.bukkit.enchantments.EnchantmentDeprecated.useXModule.get()instead.static booleanisArthropodsEffectiveAgainst(@Nullable org.bukkit.entity.EntityType type) Deprecated.static booleanisSmiteEffectiveAgainst(@Nullable org.bukkit.entity.EntityType type) Deprecated.static @NotNull Optional<XEnchantment> matchXEnchantment(@NotNull String enchantment) Deprecated.Useof(String)instead.static @NotNull XEnchantmentmatchXEnchantment(@NotNull org.bukkit.enchantments.Enchantment enchantment) Deprecated.Useof(Enchantment)instead.static Optional<XEnchantment> static @NotNull XEnchantmentof(@NotNull org.bukkit.enchantments.Enchantment enchantment) static @NotNull XEnchantment[]values()Deprecated.UseREGISTRY->XRegistry.getValues()instead.Methods inherited from class com.cryptomorin.xseries.base.XModule
equals, get, getNames, hashCode, name, setEnumName, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.cryptomorin.xseries.base.XBase
friendlyName, getMetadata, isSupported, or
-
Field Details
-
REGISTRY
-
AQUA_AFFINITY
-
BANE_OF_ARTHROPODS
-
BINDING_CURSE
-
BLAST_PROTECTION
-
BREACH
-
CHANNELING
-
DENSITY
-
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
-
SWIFT_SNEAK
-
THORNS
-
UNBREAKING
-
VANISHING_CURSE
-
WIND_BURST
-
SWEEPING_EDGE
-
VALUES
Deprecated.UseREGISTRY->XRegistry.getValues()instead.Cached list ofvalues()to avoid allocating memory for- Since:
- 1.0.0
-
EFFECTIVE_SMITE_ENTITIES
Deprecated.Entity types thatSMITEenchantment is effective against. This set is unmodifiable.- Since:
- 1.2.0
-
EFFECTIVE_BANE_OF_ARTHROPODS_ENTITIES
@Deprecated public static final Set<org.bukkit.entity.EntityType> EFFECTIVE_BANE_OF_ARTHROPODS_ENTITIESDeprecated.Entity types thatBANE_OF_ARTHROPODSenchantment is effective against. This set is unmodifiable.- Since:
- 1.2.0
-
-
Method Details
-
of
@NotNull public static @NotNull XEnchantment of(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment) -
of
-
values
Deprecated.UseREGISTRY->XRegistry.getValues()instead. -
isSmiteEffectiveAgainst
@Deprecated public static boolean isSmiteEffectiveAgainst(@Nullable @Nullable org.bukkit.entity.EntityType type) Deprecated.Checks ifSmiteis effective against this type of mob.- Parameters:
type- the type of the mob.- Returns:
- true if smite enchantment is effective against the mob, otherwise false.
- Since:
- 1.1.0
-
isArthropodsEffectiveAgainst
@Deprecated public static boolean isArthropodsEffectiveAgainst(@Nullable @Nullable org.bukkit.entity.EntityType type) Deprecated.Checks ifBane of Arthropodsis effective against this type of mob.- Parameters:
type- the type of the mob.- Returns:
- true if Bane of Arthropods enchantment is effective against the mob, otherwise false.
- Since:
- 1.1.0
-
matchXEnchantment
@NotNull @Deprecated public static @NotNull Optional<XEnchantment> matchXEnchantment(@NotNull @NotNull String enchantment) Deprecated.Useof(String)instead.Gets an enchantment from Vanilla and bukkit names. There are also some aliases available.- Parameters:
enchantment- the name of the enchantment.- Returns:
- an enchantment.
- Since:
- 1.0.0
-
matchXEnchantment
@NotNull @Deprecated public static @NotNull XEnchantment matchXEnchantment(@NotNull @NotNull org.bukkit.enchantments.Enchantment enchantment) Deprecated.Useof(Enchantment)instead.Gets an enchantment from Vanilla and bukkit names. There are also some aliases available.- Parameters:
enchantment- the enchantment.- Returns:
- an enchantment.
- Throws:
IllegalArgumentException- may be thrown as an unexpected exception.- Since:
- 1.0.0
-
getBook
@NotNull public @NotNull org.bukkit.inventory.ItemStack getBook(int level) Gets the enchanted book of this enchantment.- Parameters:
level- the level of this enchantment.- Returns:
- an enchanted book.
- Since:
- 1.0.0
-
getEnchant
Deprecated.useXModule.get()instead.Parse the Vanilla enchantment.- Returns:
- a Vanilla enchantment.
- Since:
- 1.0.0
-
XTag.EFFECTIVE_BANE_OF_ARTHROPODS_ENTITIES