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:
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
- Since:
- February 27, 2019 (Pixelmon 7.0.4)
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Class used for storing constants relating to the cause of thePokedexEvent
static class
Fired after the player's pokedex is updatedstatic class
Event fired just before the player's pokedex is updated Cancelling will mean the pokemon doesn't get modified in their pokedexNested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event
net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
-
Field Summary
Modifier and TypeFieldDescriptionprotected String
protected PokedexRegistrationStatus
protected final PokedexRegistrationStatus
protected Pokemon
protected final UUID
-
Constructor Summary
ModifierConstructorDescriptionPokedexEvent
(UUID uuid, PokedexRegistrationStatus oldStatus, Pokemon pokemon, PokedexRegistrationStatus newStatus, String cause) protected
PokedexEvent
(UUID uuid, Pokemon pokemon, PokedexRegistrationStatus newStatus, String cause) -
Method Summary
Modifier and TypeMethodDescriptiongetCause()
Gets the cause of the eventGets the registration status it's transitioning toGets the registration status it's transitioning fromnet.minecraft.server.level.ServerPlayer
Gets the player relating to the eventGets the UUID of the player for the eventGets the Pokemon relevant to the dex eventboolean
boolean
isCausedBy
(String... causes) Checks if the event was caused by one of the given causesboolean
boolean
boolean
boolean
boolean
boolean
boolean
boolean
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult
-
Field Details
-
uuid
-
oldStatus
-
pokemon
-
newStatus
-
cause
-
-
Constructor Details
-
PokedexEvent
protected PokedexEvent(UUID uuid, Pokemon pokemon, PokedexRegistrationStatus newStatus, String cause) -
PokedexEvent
public PokedexEvent(UUID uuid, PokedexRegistrationStatus oldStatus, Pokemon pokemon, PokedexRegistrationStatus newStatus, String cause)
-
-
Method Details
-
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
Gets the Pokemon relevant to the dex event- Returns:
- The Pokemon causing the event
-
getPokedex
-
getNewStatus
Gets the registration status it's transitioning to- Returns:
- The new registration status
-
getOldStatus
Gets the registration status it's transitioning from- Returns:
- The old registration status
-
getCause
Gets the cause of the event- Returns:
- The cause
-
isCausedBy
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()
-