Class EntityCastContext

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

public class EntityCastContext extends CastContext
EntityCastContext - Casting Context for Entities

Specialized context used when a non-player entity (NPC, mob, minion) casts a spell. This context is essential for spells that can be used by both players and hostile or allied entities.

It provides information about the casting entity, the hand used for casting, and an optional target entity.

See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected net.minecraft.world.InteractionHand
     
    protected @Nullable net.minecraft.world.entity.LivingEntity
     

    Fields inherited from class com.binaris.wizardry.api.content.spell.internal.CastContext

    caster, castingTicks, modifiers, world
  • Constructor Summary

    Constructors
    Constructor
    Description
    EntityCastContext(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity caster, net.minecraft.world.InteractionHand hand, int castingTicks, @Nullable net.minecraft.world.entity.LivingEntity target, SpellModifiers modifiers)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.InteractionHand
     
    void
    hand(net.minecraft.world.InteractionHand hand)
     
    @Nullable net.minecraft.world.entity.LivingEntity
     
    void
    target(@Nullable net.minecraft.world.entity.LivingEntity target)
     

    Methods inherited from class com.binaris.wizardry.api.content.spell.internal.CastContext

    caster, castingTicks, castingTicks, modifiers, modifiers, world

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • hand

      protected net.minecraft.world.InteractionHand hand
    • target

      @Nullable protected @Nullable net.minecraft.world.entity.LivingEntity target
  • Constructor Details

    • EntityCastContext

      public EntityCastContext(net.minecraft.world.level.Level world, net.minecraft.world.entity.LivingEntity caster, net.minecraft.world.InteractionHand hand, int castingTicks, @Nullable @Nullable net.minecraft.world.entity.LivingEntity target, SpellModifiers modifiers)
  • Method Details

    • hand

      public net.minecraft.world.InteractionHand hand()
    • target

      @Nullable public @Nullable net.minecraft.world.entity.LivingEntity target()
    • hand

      public void hand(net.minecraft.world.InteractionHand hand)
    • target

      public void target(@Nullable @Nullable net.minecraft.world.entity.LivingEntity target)