Interface SpellFieldEntityEffect

All Superinterfaces:
SpellFieldEffect
All Known Implementing Classes:
AbsoluteStasisEffect, AirSupplyEffect, ApplyPotionEffect, BurstEntityVisualEffect, ClearEffectsEffect, DamageEffect, DisarmEffect, ExplodeEffect, ExtinguishEffect, HealEffect, IgniteEffect, ImpulseEffect, LightningStrikeEffect, OrbitEffect, PlaySoundEntityEffect, RandomTeleportEffect, ResetLifetimeEffect, SummonEntityEffect, SummonLingeringPotionEffect, SurfaceHazardEffect

public interface SpellFieldEntityEffect extends SpellFieldEffect
Contract for a SpellFieldEffect applied to individual entities intersecting an evaluated spell field volume.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.world.entity.Entity victim, float volumeScalar)
    Executes the entity effect logic on the specified victim.
    static net.minecraft.world.level.storage.loot.LootContext
    createLootContext(net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity target, int enchantmentLevel)
    Constructs a standard LootContext parameterized with LootContextParamSets.ENCHANTED_ENTITY for evaluating ContextAwarePredicate entity filters.

    Methods inherited from interface johnsmith.enchantmentcore.api.enchantment.spellfield.effect.SpellFieldEffect

    codec
  • Method Details

    • apply

      void apply(net.minecraft.server.level.ServerLevel level, int enchantmentLevel, net.minecraft.world.item.enchantment.EnchantedItemInUse context, net.minecraft.world.entity.Entity spatialReference, net.minecraft.world.phys.Vec3 epicenter, net.minecraft.world.entity.Entity victim, float volumeScalar)
      Executes the entity effect logic on the specified victim.
      Parameters:
      level - The executing server level.
      enchantmentLevel - The active level of the spell field enchantment.
      context - The item usage context triggering the spell field.
      spatialReference - The anchor entity or focal point of the spell field.
      epicenter - The exact spatial origin vector of the spell field.
      victim - The target entity intersecting the spell field.
      volumeScalar - The active topological multiplier for victim in $(0.0, 1.0]$.
    • createLootContext

      static net.minecraft.world.level.storage.loot.LootContext createLootContext(net.minecraft.server.level.ServerLevel level, net.minecraft.world.entity.Entity target, int enchantmentLevel)
      Constructs a standard LootContext parameterized with LootContextParamSets.ENCHANTED_ENTITY for evaluating ContextAwarePredicate entity filters.
      Parameters:
      level - The executing server level.
      target - The candidate target entity being tested.
      enchantmentLevel - The active level of the spell field enchantment.
      Returns:
      The constructed LootContext.