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

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Fired when the battle mega evolution is about to happen Cancelling will prevent the mega evolution
    static class 
    Fired when the move skill mega evolution is about to happen Cancelling will prevent the mega evolution
    static class 
    Fired after all the mega evolution logic is complete This is not cancellable
    static class 
    Fired just before the mega evolution logic occurs

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    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 Type
    Method
    Description
    Gets the pixelmon entity from the world if it exists
    net.minecraft.server.level.ServerPlayer
    The player calling the mega evolution
    Gets the pokemon that is mega evolving
    Optional<net.minecraft.world.item.ItemStack>
    Gets the ItemStack used for the mega evolution Will return an empty optional of there was no item used
    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
    boolean
    If the evolution is an ultra burst This will always be false for the pre event

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • MegaEvolutionEvent

      protected MegaEvolutionEvent(net.minecraft.server.level.ServerPlayer player, Pokemon pokemon)
    • 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

      public Pokemon getPokemon()
      Gets the pokemon that is mega evolving
      Returns:
      The pokemon
    • getStone

      public Optional<net.minecraft.world.item.ItemStack> getStone()
      Gets the ItemStack used for the mega evolution Will return an empty optional of there was no item used
      Returns:
      The item used
    • getStoneItem

      public Optional<MegaStoneItem> 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

      public Optional<PixelmonEntity> getEntity()
      Gets the pixelmon entity from the world if it exists
      Returns:
      The pixelmon entity