Class HiddenPowerCalculateEvent

java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.battles.HiddenPowerCalculateEvent

public class HiddenPowerCalculateEvent extends net.neoforged.bus.api.Event
Called when the hidden power is being calculated by a given source This cannot be cancelled
  • Constructor Details

    • HiddenPowerCalculateEvent

      public HiddenPowerCalculateEvent(String cause, Pokemon pokemon, Element calculatedValue)
      Initial constructor
      Parameters:
      cause - The cause of the event
      pokemon - The pokemon being calculated for
      calculatedValue - The calculated element
  • Method Details

    • getCause

      public String getCause()
      Gets the cause
      Returns:
      The cause
    • getPokemon

      public Pokemon getPokemon()
      Gets the Pokemon being calculated for
      Returns:
      The pokemon
    • getPlayer

      public net.minecraft.world.entity.player.Player getPlayer()
      Gets the player that triggered the calculation
      Returns:
      The player
    • isInternal

      public boolean isInternal()
      Checks if the cause was something inside the Pixelmon mod - if false it means it was a plugin or someone made a mistake :))
      Returns:
      True if from pixelmon
    • getCalculatedValue

      public Element getCalculatedValue()
      Gets the calculated hidden power
      Returns:
      The hidden power
    • setCalculatedValue

      public void setCalculatedValue(Element calculatedValue)
      Sets the new calculated value
      Parameters:
      calculatedValue - The new calculated value
    • getBattlePokemon

      public Optional<PixelmonWrapper> getBattlePokemon()
      Gets the battle wrapper for the pokemon if they're in battle
      Returns:
      The battle wrapper