Class PetStatusEvent


public class PetStatusEvent extends PetEvent
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.

  • Constructor Details

    • PetStatusEvent

      public PetStatusEvent(Pet pet, Pet.PetState state)
      Creates the event for a completed lifecycle state transition.
      Parameters:
      pet - the pet whose state changed
      state - the state it has moved into
  • Method Details

    • getHandlerList

      public static HandlerList getHandlerList()
      Returns the handler list for this event type.
      Returns:
      the shared HandlerList every PetStatusEvent is dispatched through
    • getHandlers

      public @NonNull HandlerList getHandlers()
      Specified by:
      getHandlers in class Event
    • getPet

      public Pet getPet()
      The pet whose lifecycle state changed.
      Specified by:
      getPet in class PetEvent
      Returns:
      the pet whose state changed
    • getState

      public Pet.PetState getState()
      The state the pet has just moved into.
      Returns:
      the state it has moved into