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 Summary
FieldsFields inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
battleController
-
Constructor Summary
ConstructorsConstructorDescriptionExperienceGainEvent
(BattleController controller, Pokemon pokemon, int experience, ExperienceGainType type) ExperienceGainEvent
(BattleController controller, Pokemon pokemon, Pokemon faintedPokemon, int experience, ExperienceGainType type) -
Method Summary
Modifier and TypeMethodDescriptionint
Gets how much experience will be given currently.Gets the Pokémon that fainted and is giving the experience.getType()
Gets how the experience has been gained.boolean
void
setExperience
(int experience) Sets the new experience that will be given.Methods inherited from class com.pixelmonmod.pixelmon.api.events.battles.BattleEvent
getBattleController
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.neoforged.bus.api.ICancellableEvent
isCanceled, setCanceled
-
Field Details
-
pokemon
The Pokémon gaining the experience
-
-
Constructor Details
-
ExperienceGainEvent
public ExperienceGainEvent(@Nullable BattleController controller, Pokemon pokemon, int experience, ExperienceGainType type) -
ExperienceGainEvent
public ExperienceGainEvent(@Nullable BattleController controller, Pokemon pokemon, Pokemon faintedPokemon, int experience, ExperienceGainType type)
-
-
Method Details
-
isFromBattle
public boolean isFromBattle() -
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
Gets how the experience has been gained.
-