Enum Class AnimationTarget

java.lang.Object
java.lang.Enum<AnimationTarget>
com.pixelmonmod.pixelmon.api.battles.attack.animation.AnimationTarget
All Implemented Interfaces:
Serializable, Comparable<AnimationTarget>, Constable

public enum AnimationTarget extends Enum<AnimationTarget>
Identifies a battle participant that can be used as an animation target.

Animation targets are resolved against an active ActiveBattleAnimation, allowing animation data to refer to contextual battle participants such as the attack user or the attack target without storing direct entity references in the data itself.

  • Enum Constant Details

    • USER

      public static final AnimationTarget USER
      The Pokémon using the attack.
    • TARGET

      public static final AnimationTarget TARGET
      The Pokémon targeted by the attack.
  • Field Details

    • CODEC

      public static final com.mojang.serialization.Codec<AnimationTarget> CODEC
  • Method Details

    • values

      public static AnimationTarget[] values()
      Returns an array containing the constants of this enum class, in the order they are declared.
      Returns:
      an array containing the constants of this enum class, in the order they are declared
    • valueOf

      public static AnimationTarget valueOf(String name)
      Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)
      Parameters:
      name - the name of the enum constant to be returned.
      Returns:
      the enum constant with the specified name
      Throws:
      IllegalArgumentException - if this enum class has no constant with the specified name
      NullPointerException - if the argument is null
    • target

      public PixelmonWrapper target(ActiveBattleAnimation animation)
      Resolves this animation target for the supplied active animation.
      Parameters:
      animation - the active attack animation
      Returns:
      the resolved battle participant