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(net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, net.minecraft.world.item.ItemStack target, EnchantingContext enchantingContext) Checks whether anEnchantmentshould be applied to a givenItemStack.
-
Method Details
-
allowEnchanting
TriState allowEnchanting(net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, net.minecraft.world.item.ItemStack target, EnchantingContext enchantingContext) Checks whether anEnchantmentshould 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.TRUEif the enchantment may be applied,TriState.FALSEif it may not,TriState.DEFAULTto fall back to other callbacks/vanilla behavior- See Also:
-