Package de.Keyle.MyPet.api.event
Class PetExhaustionEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetExhaustionEvent
- All Implemented Interfaces:
Cancellable
Fired when a pet's saturation drops to zero — the pet is hungry and would
otherwise begin losing health. Lets addons award food, suppress the
starvation hit, or surface custom messaging.
Fires from Pet#updateSaturation once per saturation-zero
transition; after firing, if not canceled, the pet's health begins ticking
down from hunger.
Cancellable: cancelling skips the starvation health-loss for this
tick — but the saturation remains at 0, so the event will fire again next
saturation tick unless something refills it (a food item, an addon, or
/petadmin feed).
Pet state: live pet; owner online
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetExhaustionEvent(Pet pet) Creates the event for a pet that has run out of saturation. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The pet whose saturation has reached zero.Methods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetExhaustionEvent
Creates the event for a pet that has run out of saturation.- Parameters:
pet- the hungry pet
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetExhaustionEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet whose saturation has reached zero.
-