Class PetRemoveEvent


public class PetRemoveEvent extends PetEvent
Fired when a pet is being permanently removed from the repository — the symmetric counterpart to PetCreateEvent. The PetRemoveEvent.Source discriminates the removal pathway:

Fires from CommandRelease, CommandOptionRemove, PetDeathListener, and PetMenuMenuHandler.

Not cancellable: the deletion has already been committed (or scheduled) when this event fires. Veto must happen earlier — for releases, intercept the command; for deaths, intercept EntityDeathEvent; for admin removals, use permissions on the admin command.

Pet state: may be live or persisted depending on source. For Death the pet was live; for Release and AdminCommand either is possible. The repository lookup is still valid at event time — listeners can read the final pet state for logging / cleanup.

  • Constructor Details

    • PetRemoveEvent

      public PetRemoveEvent(StoredPet pet, PetRemoveEvent.Source source)
      Creates the event for a pet leaving the repository for good.
      Parameters:
      pet - the pet being removed
      source - the pathway that removed it
  • Method Details

    • getHandlerList

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

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

      public StoredPet getPet()
      The pet being removed; still readable for logging and cleanup.
      Specified by:
      getPet in class PetEvent
      Returns:
      the pet being removed
    • getSource

      public PetRemoveEvent.Source getSource()
      The pathway the removal came through.
      Returns:
      the pathway that removed it