Class AttackEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
com.pixelmonmod.pixelmon.api.events.battles.AttackEvent
Direct Known Subclasses:
AttackEvent.CriticalHit, AttackEvent.Damage, AttackEvent.Recoil, AttackEvent.Stab, AttackEvent.TypeEffectiveness, AttackEvent.Use

public abstract class AttackEvent extends BattleEvent
Collection of events fired relating to Pokémon moves in battle.

Subclasses: AttackEvent.Use, AttackEvent.CriticalHit, AttackEvent.Stab, AttackEvent.Damage, AttackEvent.TypeEffectiveness.

Since:
June 18, 2019
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Event fired after Pixelmon calculates the critical hit multiplier for this attack.
    static class 
    Event fired after all damage calculations have taken place for an attack.
    static class 
    Event fired after recoil damage has been taken.
    static class 
    Event fired after Pixelmon calculates the STAB multiplier for this attack.
    static class 
    Event fired when calculating move effectiveness.
    static class 
    Event fired after any attack is used.

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    The target of the attack.
    The user of the attack.

    Fields inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent

    battleController
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    AttackEvent(BattleController battleController, PixelmonWrapper user, PixelmonWrapper target)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    The attack being used.
    boolean
    Whether or not the user is the target.

    Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent

    getBattleController

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

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

    • user

      public final PixelmonWrapper user
      The user of the attack.
    • target

      public final PixelmonWrapper target
      The target of the attack. This might be the same as the user.
  • Constructor Details

  • Method Details

    • getAttack

      public Attack getAttack()
      The attack being used. This is just a shortcut to user.attack.
    • isSelf

      public boolean isSelf()
      Whether or not the user is the target.