Package de.Keyle.MyPet.api.event
Class PetRemoveEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.PetRemoveEvent
Fired when a pet is being permanently removed from the repository — the
symmetric counterpart to
PetCreateEvent. The PetRemoveEvent.Source
discriminates the removal pathway:
PetRemoveEvent.Source.RELEASE— owner ran/mypet release.PetRemoveEvent.Source.DEATH— pet died and was configured (or required by respawn-time = -1) to be deleted on death.PetRemoveEvent.Source.ADMIN_COMMAND— admin removal via/petadmin remove.PetRemoveEvent.Source.OTHER— third-party plugin path.
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.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetRemoveEvent(StoredPet pet, PetRemoveEvent.Source source) Creates the event for a pet leaving the repository for good. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The pet being removed; still readable for logging and cleanup.The pathway the removal came through.Methods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetRemoveEvent
Creates the event for a pet leaving the repository for good.- Parameters:
pet- the pet being removedsource- the pathway that removed it
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetRemoveEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet being removed; still readable for logging and cleanup. -
getSource
The pathway the removal came through.- Returns:
- the pathway that removed it
-