Enum Class EnchantmentLevel
- All Implemented Interfaces:
Serializable,Comparable<EnchantmentLevel>,Constable
Calculates enchantment levels using different methods.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionReturns the combined level of all matching enchantments.Returns the level of the first matching enchantment.Returns the highest level among all matching enchantments.Returns the lowest level among all matching enchantments. -
Method Summary
Modifier and TypeMethodDescriptionintget(net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> enchType, net.minecraft.world.item.ItemStack stack) Gets the level of matching enchantments based on the calculation type.static EnchantmentLevelReturns the enum constant of this class with the specified name.static EnchantmentLevel[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
HIGHEST
Returns the highest level among all matching enchantments. -
LOWEST
Returns the lowest level among all matching enchantments. -
FIRST
Returns the level of the first matching enchantment. -
CUMULATIVE
Returns the combined level of all matching enchantments.
-
-
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
-
get
public int get(net.minecraft.tags.TagKey<net.minecraft.world.item.enchantment.Enchantment> enchType, net.minecraft.world.item.ItemStack stack) Gets the level of matching enchantments based on the calculation type.- Parameters:
enchType- A tag of the enchantments to match on.stack- The item to test.- Returns:
- The level based on the calculation type.
-