Class MegaEvolutionEvent
java.lang.Object
net.neoforged.bus.api.Event
com.pixelmonmod.pixelmon.api.events.MegaEvolutionEvent
- Direct Known Subclasses:
MegaEvolutionEvent.Battle,MegaEvolutionEvent.Post,MegaEvolutionEvent.Pre
public abstract class MegaEvolutionEvent
extends net.neoforged.bus.api.Event
The event representing when a Pokemon mega evolves into their Mega Form either from an external move (move skills)
or during a battle
Cancelling the event will prevent the mega evolution from going through
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classFired when the battle mega evolution is about to happen Cancelling will prevent the mega evolutionstatic classFired after all the mega evolution logic is complete This is not cancellablestatic classFired just before the mega evolution logic occurs -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedMegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon) protectedMegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack item) protectedMegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack stone, boolean ultraBurst) -
Method Summary
Modifier and TypeMethodDescriptionGets the pixelmon entity from the world if it existsnet.minecraft.server.level.ServerPlayerThe player calling the mega evolutionGets the pokemon that is mega evolvingOptional<net.minecraft.world.item.ItemStack> getStone()Gets theItemStackused for the mega evolution Will return an empty optional of there was no item usedbooleanIf the evolution is an ultra burst This will always be false for the pre event
-
Constructor Details
-
MegaEvolutionEvent
-
MegaEvolutionEvent
protected MegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack item) -
MegaEvolutionEvent
protected MegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack stone, boolean ultraBurst)
-
-
Method Details
-
getPlayer
public net.minecraft.server.level.ServerPlayer getPlayer()The player calling the mega evolution- Returns:
- The player
-
getPokemon
Gets the pokemon that is mega evolving- Returns:
- The pokemon
-
getStone
Gets theItemStackused for the mega evolution Will return an empty optional of there was no item used- Returns:
- The item used
-
isUltraBurst
public boolean isUltraBurst()If the evolution is an ultra burst This will always be false for the pre event- Returns:
- True if the pokemon is ultra bursting
-
getEntity
Gets the pixelmon entity from the world if it exists- Returns:
- The pixelmon entity
-