Interface SpellFieldEventDispatcher.ApplyInterceptor

Enclosing class:
SpellFieldEventDispatcher
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 SpellFieldEventDispatcher.ApplyInterceptor
Functional listener that intercepts the initial activation of a SpellFieldComponent.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    onApply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity target, net.minecraft.world.phys.Vec3 epicenter)
    Evaluates the spell field activation context before volume and target processing begins.
  • Method Details

    • onApply

      boolean onApply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity target, net.minecraft.world.phys.Vec3 epicenter)
      Evaluates the spell field activation context before volume and target processing begins.
      Parameters:
      level - The executing server level.
      enchantmentLevel - The level of the spell field enchantment.
      context - The item usage context triggering the spell field.
      target - The anchor entity or focal point of the spell field.
      epicenter - The exact spatial origin vector of the spell field.
      Returns:
      true to permit execution, or false to cancel the spell field application entirely.