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.

@FunctionalInterface public static interface EnchantmentEvents.AllowEnchanting
  • Method Summary

    Modifier and Type
    Method
    Description
    allowEnchanting(net.minecraft.core.Holder<net.minecraft.world.item.enchantment.Enchantment> enchantment, net.minecraft.world.item.ItemStack target, EnchantingContext enchantingContext)
    Checks whether an Enchantment should be applied to a given ItemStack.
  • 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 an Enchantment should be applied to a given ItemStack.
      Parameters:
      enchantment - the enchantment that may be applied
      target - the target item
      enchantingContext - 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: