java.lang.Object
com.binaris.wizardry.api.content.spell.internal.CastContext
Direct Known Subclasses:
EntityCastContext, LocationCastContext, PlayerCastContext

public class CastContext extends Object
CastContext - Base Context for Spell Casting

Base class that encapsulates the fundamental information needed to cast any spell in the mod. All spell casting context variants inherit from this class, providing a unified interface for the spell system.

This class acts as a shared data container between all types of spell casts, regardless of whether the caster is a player, an entity, or a location in the world.

Context Hierarchy

 CastContext (base)
  ├─ PlayerCastContext    - When a player casts from items (wands, scrolls)
  ├─ EntityCastContext    - When NPCs/mobs cast spells (with optional target)
  └─ LocationCastContext  - When cast from a fixed location (dispensers, constructs)
 
See Also:
  • Field Details

    • world

      protected net.minecraft.world.level.Level world
    • castingTicks

      protected int castingTicks
    • modifiers

      protected SpellModifiers modifiers
    • caster

      protected net.minecraft.world.entity.LivingEntity caster
  • Constructor Details

    • CastContext

      public CastContext(net.minecraft.world.level.Level world, int castingTicks, SpellModifiers modifiers)
    • CastContext

      public CastContext(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity caster, int castingTicks, SpellModifiers modifiers)
  • Method Details

    • caster

      public net.minecraft.world.entity.LivingEntity caster()
    • world

      public net.minecraft.world.level.Level world()
    • castingTicks

      public int castingTicks()
    • modifiers

      public SpellModifiers modifiers()
    • castingTicks

      public void castingTicks(int tick)
    • modifiers

      public void modifiers(SpellModifiers modifiers)