Class ExperienceGainEvent

java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
com.pixelmonmod.pixelmon.api.events.ExperienceGainEvent
All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class ExperienceGainEvent extends BattleEvent implements net.neoforged.bus.api.ICancellableEvent
Fired when experience is gained. The experience field can be modified to boost experience. Multiplication of the experience as opposed to irrelative summation/subtraction is advised.
  • Field Details

    • pokemon

      public final Pokemon pokemon
      The Pokémon gaining the experience
  • Constructor Details

  • Method Details

    • isFromBattle

      public boolean isFromBattle()
    • getFaintedPokemon

      @Nullable public Pokemon getFaintedPokemon()
      Gets the Pokémon that fainted and is giving the experience.
    • getExperience

      public int getExperience()
      Gets how much experience will be given currently.
    • setExperience

      public void setExperience(int experience)
      Sets the new experience that will be given.
      Parameters:
      experience - - The new amount of experience. Negatives will be forced to zero.
    • getType

      public ExperienceGainType getType()
      Gets how the experience has been gained.