Interface EnchantmentType
- All Superinterfaces:
ComponentLike,DefaultedRegistryValue,Taggable<EnchantmentType>
@CatalogedBy(EnchantmentTypes.class)
public interface EnchantmentType
extends DefaultedRegistryValue, ComponentLike, Taggable<EnchantmentType>
Represents a modifier on an item that has various effects.
-
Method Summary
Modifier and TypeMethodDescriptionbooleancanBeAppliedByTable(ItemStackLike stack) Test if this enchantment type can be applied to anItemStackLikeby theEnchantmentTable.booleancanBeAppliedToStack(ItemStackLike stack) Test if this enchantment type can be applied to anItemStackLike.booleanisCompatibleWith(EnchantmentType enchantmentType) Test if this enchantment type can be applied along with another enchantment type.default booleanisCurse()Gets whether or not this enchantment type is considered a "curse" enchantment.default 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, keyMethods inherited from interface org.spongepowered.api.tag.Taggable
is, registryType, tags
-
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 anItemStackLike.- 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 anItemStackLikeby 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
default 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
default boolean isCurse()Gets whether or not this enchantment type is considered a "curse" enchantment.- Returns:
- Whether this enchantment type is a curse enchantment type
-