Package de.Keyle.MyPet.api.event
Class PetSendAwayEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetSendAwayEvent
- All Implemented Interfaces:
Cancellable
Fired when an owner runs
/mypet sendaway — the symmetric counterpart
of PetCallEvent. Despawns the world entity but keeps the pet
active in the manager (i.e., the owner can call it back without re-loading
from disk).
Fires from CommandSendAway.
Cancellable: cancelling the event leaves the pet entity in the world. Common addon use-cases: region-locked pets that can't be dismissed inside arenas, anti-grief gates against dismissal in PvP zones.
Pet state: live pet, with the owner online (the command requires it).
After successful dispatch, the entity is removed from the world but
getPet() continues to refer to a live Pet until its
owner logs out (the periodic save flushes it back to persisted form).
Pet exposure: always a live Pet — the pet is active
and its world entity is about to be despawned.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetSendAwayEvent(Pet pet) Creates the event for a pet being dismissed from the world. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The pet whose world entity is about to be despawned.Methods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetSendAwayEvent
Creates the event for a pet being dismissed from the world.- Parameters:
pet- the pet being sent away
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetSendAwayEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet whose world entity is about to be despawned.
-