Class ManaBurnoutCostEvent

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.ManaBurnoutCostEvent

public class ManaBurnoutCostEvent extends SpellEvent

Event that fires when mana cost is retrieved.

Mana cost is calculated as (mana + burnout), where mana is retrieved from the spell and burnout is the caster's current burnout value. Modifiers added in this event will then be applied to the result.

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

  • Nested Class Summary

    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
    ManaBurnoutCostEvent(net.minecraft.world.entity.LivingEntity entity, Spell spell, double mana, double burnout)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    double
     
    double
     
    double
     
    void
    setBurnout(double burnout)
    Modifies the burnout cost.
    void
    setMana(double mana)
    Modifies the mana cost.

    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

    • ManaBurnoutCostEvent

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

    • getOriginalMana

      public double getOriginalMana()
      Returns:
      The unmodified mana cost.
    • getOriginalBurnout

      public double getOriginalBurnout()
      Returns:
      The unmodified burnout cost.
    • getMana

      public double getMana()
      Returns:
      The potentially modified mana cost.
    • setMana

      public void setMana(double mana)
      Modifies the mana cost.
      Parameters:
      mana - The new mana cost to set.
    • getBurnout

      public double getBurnout()
      Returns:
      The potentially modified burnout cost.
    • setBurnout

      public void setBurnout(double burnout)
      Modifies the burnout cost.
      Parameters:
      burnout - The new burnout cost to set.