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
Modifier and TypeClassDescriptionstatic class
Fired just after the pokemon's level changes Cannot be cancelledstatic 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
Modifier and TypeFieldDescriptionprotected int
protected int
protected final ExperienceGainType
protected final net.minecraft.server.level.ServerPlayer
protected final PokemonLink
-
Constructor Summary
ModifierConstructorDescriptionprotected
LevelUpEvent
(net.minecraft.server.level.ServerPlayer player, PokemonLink pokemon, ExperienceGainType cause, int beforeLevel, int afterLevel) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets the Pokemon's level after it was changedint
Gets the Pokemon's level before it was changedgetCause()
Gets the cause of the level upint
Gets the numerical difference in level from before & after the eventnet.minecraft.server.level.ServerPlayer
Gets the playerGets the Pokemon leveling upGets the link of the Pokemon leveling upMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
player
protected final net.minecraft.server.level.ServerPlayer player -
pokemon
-
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
Gets the link of the Pokemon leveling up- Returns:
- The link
-
getPokemon
Gets the Pokemon leveling up- Returns:
-
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
-