Package net.fabricmc.fabric.api.item.v1
Interface EnchantmentEvents.AllowEnchanting
- Enclosing class:
EnchantmentEvents
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
-
Method Summary
Modifier and TypeMethodDescriptionallowEnchanting
(RegistryEntry<Enchantment> enchantment, ItemStack target, EnchantingContext enchantingContext) Checks whether anEnchantment
should be applied to a givenItemStack
.
-
Method Details
-
allowEnchanting
TriState allowEnchanting(RegistryEntry<Enchantment> enchantment, ItemStack target, EnchantingContext enchantingContext) Checks whether anEnchantment
should be applied to a givenItemStack
.- Parameters:
enchantment
- the enchantment that may be appliedtarget
- the target itemenchantingContext
- the enchanting context in which this check is made- Returns:
TriState.TRUE
if the enchantment may be applied,TriState.FALSE
if it may not,TriState.DEFAULT
to fall back to other callbacks/vanilla behavior- See Also:
-