Class PokedexEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
com.pixelmonmod.pixelmon.api.events.PokedexEvent
Direct Known Subclasses:
PokedexEvent.Post, PokedexEvent.Pre

public class PokedexEvent extends net.minecraftforge.eventbus.api.Event
Fired when a new Pokémon is being added to the Pokédex as seen or caught. The cause of the addition (trade, capture, etc.) is not calculated here, but is left to the handler.

Important notes about the details of this event:
  • A Pokédex update is fired for every movement of a Pokémon in a party/PC.
  • At the time of writing, Pokédex updates are also called for capture, trades, evolution, and eggs hatching.
  • The player whose Pokédex is being updated might not be online during event firing
Cancelling this event will prevent the Pokédex from accepting this change. If you do block a specific cause of Pokédex update then you also will need to block the storage movement cause, otherwise you're wasting your time. Alternatively, you could 'tag' Pokémon that were received through the causes you want to block and block only the storage movement Pokédex events that are tagged.

Since:
February 27, 2019 (Pixelmon 7.0.4)
  • Field Details

  • Constructor Details

  • Method Details

    • getPlayerUUID

      public UUID getPlayerUUID()
      Gets the UUID of the player for the event
      Returns:
      The UUID
    • getPlayer

      public net.minecraft.server.level.ServerPlayer getPlayer()
      Gets the player relating to the event
      Returns:
      The player
    • getPokemon

      public Pokemon getPokemon()
      Gets the Pokemon relevant to the dex event
      Returns:
      The Pokemon causing the event
    • getPokedex

      public PlayerPokedex getPokedex()
    • getNewStatus

      public PokedexRegistrationStatus getNewStatus()
      Gets the registration status it's transitioning to
      Returns:
      The new registration status
    • getOldStatus

      public PokedexRegistrationStatus getOldStatus()
      Gets the registration status it's transitioning from
      Returns:
      The old registration status
    • getCause

      public String getCause()
      Gets the cause of the event
      Returns:
      The cause
    • isCausedBy

      public boolean isCausedBy(String... causes)
      Checks if the event was caused by one of the given causes
      Parameters:
      causes - The cause
      Returns:
      True if it was caused by one of them
    • isCausedByCapture

      public boolean isCausedByCapture()
    • isCausedByPlayerTrade

      public boolean isCausedByPlayerTrade()
    • isCausedByNPCTrade

      public boolean isCausedByNPCTrade()
    • isCausedByEvolution

      public boolean isCausedByEvolution()
    • isCausedByEggHatching

      public boolean isCausedByEggHatching()
    • isCausedByStorageMovement

      public boolean isCausedByStorageMovement()
    • isBeingSeenByPokedexKey

      public boolean isBeingSeenByPokedexKey()
    • isCausedBySidemod

      public boolean isCausedBySidemod()
    • isInternal

      public boolean isInternal()