Class LevelUpEvent.Pre

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.LevelUpEvent
com.pixelmonmod.pixelmon.api.events.LevelUpEvent.Pre
Enclosing class:
LevelUpEvent

public static class LevelUpEvent.Pre extends LevelUpEvent
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. mass level up will not level up at all and won't attempt again)
  • Constructor Details

    • Pre

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

    • setAfterLevel

      public void setAfterLevel(int afterLevel)
      Modifies the level the Pokemon will go to
      Parameters:
      afterLevel - The new level the pokemon will level up to