Class LocationCastContext

java.lang.Object
com.binaris.wizardry.api.content.spell.internal.CastContext
com.binaris.wizardry.api.content.spell.internal.LocationCastContext

public class LocationCastContext extends CastContext
LocationCastContext - Casting Context from Fixed Location

Specialized context used when a spell is cast from a specific location in the world without a living caster (entity). This is the only context where caster() always returns null.

This context gives access to the exact position and direction of the cast, as well as a duration for spells that require it (e.g., constructs). It is primarily used for spells cast by blocks or environmental effects.

See Also:
  • Field Details

    • vec3

      protected net.minecraft.world.phys.Vec3 vec3
    • direction

      protected net.minecraft.core.Direction direction
    • duration

      protected int duration
  • Constructor Details

    • LocationCastContext

      public LocationCastContext(net.minecraft.world.level.Level world, double x, double y, double z, net.minecraft.core.Direction direction, int castingTicks, int duration, SpellModifiers modifiers)
  • Method Details

    • caster

      public net.minecraft.world.entity.LivingEntity caster()
      Overrides:
      caster in class CastContext
    • vec3

      public net.minecraft.world.phys.Vec3 vec3()
    • pos

      public net.minecraft.core.BlockPos pos()
    • x

      public double x()
    • y

      public double y()
    • z

      public double z()
    • direction

      public net.minecraft.core.Direction direction()
    • duration

      public int duration()
    • vec3

      public void vec3(net.minecraft.world.phys.Vec3 vec3)
    • direction

      public void direction(net.minecraft.core.Direction direction)
    • duration

      public void duration(int duration)