Interface EnchantmentType
- All Superinterfaces:
ComponentLike,DefaultedRegistryValue
@CatalogedBy(EnchantmentTypes.class)
public interface EnchantmentType
extends DefaultedRegistryValue, ComponentLike
Represents a modifier on an item that has various effects.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeAppliedByTable(ItemStack stack) Test if this enchantment type can be applied to anItemStackby theEnchantmentTable.booleancanBeAppliedToStack(ItemStack stack) Test if this enchantment type can be applied to anItemStack.booleanisCompatibleWith(EnchantmentType enchantmentType) Test if this enchantment type can be applied along with another enchantment type.booleanisCurse()Gets whether or not this enchantment type is considered a "curse" enchantment.booleanGets whether or not this enchantment type is considered a "treasure" enchantment.intmaximumEnchantabilityForLevel(int level) Gets the maximum item enchantability for this level to be normally added by enchanting tables.intGets the maximum level of this enchantment type normally allowed.intminimumEnchantabilityForLevel(int level) Gets the minimum item enchantability for this level to be normally added by enchanting tables.intGets the minimum level of this enchantment type allowed where it is present.intweight()Gets the weight of this enchantment type.Methods inherited from interface net.kyori.adventure.text.ComponentLike
asComponentMethods inherited from interface org.spongepowered.api.registry.DefaultedRegistryValue
asDefaultedReference, findKey, key
-
Method Details
-
weight
int weight()Gets the weight of this enchantment type.Higher values are more common. This value is also used in the repair cost calculation.
- Returns:
- The weight of this enchantment type
-
minimumLevel
int minimumLevel()Gets the minimum level of this enchantment type allowed where it is present.- Returns:
- The minimum level
-
maximumLevel
int maximumLevel()Gets the maximum level of this enchantment type normally allowed.- Returns:
- The maximum level
-
minimumEnchantabilityForLevel
int minimumEnchantabilityForLevel(int level) Gets the minimum item enchantability for this level to be normally added by enchanting tables.- Parameters:
level- The enchantment type level- Returns:
- The minimum enchantability
-
maximumEnchantabilityForLevel
int maximumEnchantabilityForLevel(int level) Gets the maximum item enchantability for this level to be normally added by enchanting tables.- Parameters:
level- The enchantment type level- Returns:
- The maximum enchantability
-
canBeAppliedToStack
Test if this enchantment type can be applied to anItemStack.- Parameters:
stack- The item stack to check- Returns:
- Whether this enchantment type can be applied
-
canBeAppliedByTable
Test if this enchantment type can be applied to anItemStackby theEnchantmentTable.- Parameters:
stack- Te item stack to check- Returns:
- Whether this enchantment type can be applied by the enchantment table
-
isCompatibleWith
Test if this enchantment type can be applied along with another enchantment type.- Parameters:
enchantmentType- The enchantment type to test compatibility with- Returns:
- Whether these enchantment types are compatible
-
isTreasure
boolean isTreasure()Gets whether or not this enchantment type is considered a "treasure" enchantment.These do not occur naturally in enchantment tables.
- Returns:
- Whether this enchantment type is a treasure enchantment type
-
isCurse
boolean isCurse()Gets whether or not this enchantment type is considered a "curse" enchantment.- Returns:
- Whether this enchantment type is a curse enchantment type
-