Class MegaEvolutionEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.MegaEvolutionEvent
- Direct Known Subclasses:
MegaEvolutionEvent.Battle
,MegaEvolutionEvent.MoveSkill
,MegaEvolutionEvent.Post
,MegaEvolutionEvent.Pre
public abstract class MegaEvolutionEvent
extends net.minecraftforge.eventbus.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
Modifier and TypeClassDescriptionstatic class
Fired when the battle mega evolution is about to happen Cancelling will prevent the mega evolutionstatic class
Fired when the move skill mega evolution is about to happen Cancelling will prevent the mega evolutionstatic class
Fired after all the mega evolution logic is complete This is not cancellablestatic class
Fired just before the mega evolution logic occursNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Constructor Summary
ModifierConstructorDescriptionprotected
MegaEvolutionEvent
(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon) protected
MegaEvolutionEvent
(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon, net.minecraft.world.item.ItemStack item) protected
MegaEvolutionEvent
(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.ServerPlayer
The player calling the mega evolutionGets the pokemon that is mega evolvingOptional<net.minecraft.world.item.ItemStack>
getStone()
Gets theItemStack
used for the mega evolution Will return an empty optional of there was no item usedGets the item used to mega evolve if one was used If there was no item used it will return an empty optional This will always be empty for the pre eventboolean
If the evolution is an ultra burst This will always be false for the pre eventMethods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
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 theItemStack
used for the mega evolution Will return an empty optional of there was no item used- Returns:
- The item used
-
getStoneItem
Gets the item used to mega evolve if one was used If there was no item used it will return an empty optional This will always be empty for the pre event- 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
-