Package de.Keyle.MyPet.api.event
Class PetStatusEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.PetStatusEvent
Fired when a pet's lifecycle
PetState transitions — e.g., from
Here (entity in the world) to Despawned (entity removed
but pet still active) or to Dead (post-death respawn timer).
Fires from Pet#updateStatus once per state transition.
Not cancellable: the status change is already applied when this
event fires. Read the new state via getState().
Pet state: live pet (status transitions only happen on the live runtime).
Related events: PetCallEvent fires before a Here
transition; PetSendAwayEvent fires before a Despawned
transition. Death has no dedicated Pet-side event — listen to
EntityDeathEvent on the marked pet entity, or to the
PetRemoveEvent PetRemoveEvent.Source.DEATH source if
the pet is configured to delete on death.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetStatusEvent(Pet pet, Pet.PetState state) Creates the event for a completed lifecycle state transition. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The pet whose lifecycle state changed.getState()The state the pet has just moved into.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetStatusEvent
Creates the event for a completed lifecycle state transition.- Parameters:
pet- the pet whose state changedstate- the state it has moved into
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetStatusEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet whose lifecycle state changed. -
getState
The state the pet has just moved into.- Returns:
- the state it has moved into
-