Class LevelUpEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.LevelUpEvent
Direct Known Subclasses:
LevelUpEvent.Post, LevelUpEvent.Pre

public class LevelUpEvent extends net.minecraftforge.eventbus.api.Event
Event relating to when a Pokemon is leveling up
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Fired just after the pokemon's level changes Cannot be cancelled
    static class 
    Fired just before the level up occurs Cancelling will prevent the pokemon's level from increasing, and any subsequent changes that'd have happened after (i.e.

    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
    protected int
     
    protected int
     
    protected final ExperienceGainType
     
    protected final net.minecraft.server.level.ServerPlayer
     
    protected final PokemonLink
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    LevelUpEvent(net.minecraft.server.level.ServerPlayer player, PokemonLink pokemon, ExperienceGainType cause, int beforeLevel, int afterLevel)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Gets the Pokemon's level after it was changed
    int
    Gets the Pokemon's level before it was changed
    Gets the cause of the level up
    int
    Gets the numerical difference in level from before & after the event
    net.minecraft.server.level.ServerPlayer
    Gets the player
    Gets the Pokemon leveling up
    Gets the link of the Pokemon leveling up

    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

    • player

      protected final net.minecraft.server.level.ServerPlayer player
    • pokemon

      protected final PokemonLink pokemon
    • cause

      protected final ExperienceGainType cause
    • beforeLevel

      protected int beforeLevel
    • afterLevel

      protected int afterLevel
  • Constructor Details

    • LevelUpEvent

      protected LevelUpEvent(net.minecraft.server.level.ServerPlayer player, PokemonLink pokemon, ExperienceGainType cause, int beforeLevel, int afterLevel)
  • Method Details

    • getPlayer

      @Nullable public net.minecraft.server.level.ServerPlayer getPlayer()
      Gets the player
      Returns:
      The player who's pokemon is leveling up
    • getPokemonLink

      public PokemonLink getPokemonLink()
      Gets the link of the Pokemon leveling up
      Returns:
      The link
    • getPokemon

      public Pokemon getPokemon()
      Gets the Pokemon leveling up
      Returns:
    • getCause

      public ExperienceGainType getCause()
      Gets the cause of the level up
      Returns:
      The cause
    • getBeforeLevel

      public int getBeforeLevel()
      Gets the Pokemon's level before it was changed
      Returns:
      The before level
    • getAfterLevel

      public int getAfterLevel()
      Gets the Pokemon's level after it was changed
      Returns:
      The after level
    • getLevelChange

      public int getLevelChange()
      Gets the numerical difference in level from before & after the event
      Returns:
      The change in level