Class SpellCastEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.entity.EntityEvent
net.neoforged.neoforge.event.entity.living.LivingEvent
at.minecraftschurli.mods.arsmagicalegacy.api.event.SpellEvent
at.minecraftschurli.mods.arsmagicalegacy.api.event.SpellCastEvent
Direct Known Subclasses:
SpellCastEvent.Post, SpellCastEvent.Pre

public abstract class SpellCastEvent extends SpellEvent

Event that is fired when a spell is cast. Has SpellCastEvent.Pre and SpellCastEvent.Post sub events.

In order to perform additional functionality when a particular spell part is cast, use SpellPartCastEvent.

This event is not cancelable. This event is fired on the main event bus.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Fired after the spell is cast, mana and burnout have been modified (if applicable), and magic xp has been awarded (if applicable).
    static class 
    Fired immediately before the spell is cast.

    Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent

    net.neoforged.neoforge.event.entity.living.LivingEvent.LivingJumpEvent, net.neoforged.neoforge.event.entity.living.LivingEvent.LivingVisibilityEvent

    Nested classes/interfaces inherited from class net.neoforged.neoforge.event.entity.EntityEvent

    net.neoforged.neoforge.event.entity.EntityEvent.EnteringSection, net.neoforged.neoforge.event.entity.EntityEvent.EntityConstructing, net.neoforged.neoforge.event.entity.EntityEvent.Size
  • Constructor Summary

    Constructors
    Constructor
    Description
    SpellCastEvent(net.minecraft.world.entity.LivingEntity entity, Spell spell, double mana, double burnout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    double
     

    Methods inherited from class SpellEvent

    getSpell

    Methods inherited from class net.neoforged.neoforge.event.entity.living.LivingEvent

    getEntity

    Methods inherited from class Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • SpellCastEvent

      public SpellCastEvent(net.minecraft.world.entity.LivingEntity entity, Spell spell, double mana, double burnout)
  • Method Details

    • getMana

      public double getMana()
      Returns:
      The mana cost of the spell. Final by this point, to modify, use ManaBurnoutCostEvent.
    • getBurnout

      public double getBurnout()
      Returns:
      The burnout cost of the spell. Final by this point, to modify, use ManaBurnoutCostEvent.