Package de.Keyle.MyPet.api.event
Class PetSitEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetInteractEvent
de.Keyle.MyPet.api.event.PetSitEvent
- All Implemented Interfaces:
Cancellable
Fired when a pet's sit / follow toggle is about to flip. Subclass of
PetInteractEvent; the PetSitEvent.Action discriminates the new state:
PetSitEvent.Action.STAY— pet is being told to sit / stay in place.PetSitEvent.Action.FOLLOW— pet is being told to stand up and resume following its owner.
Fires from Pet on the right-click sit-toggle interaction.
Cancellable (inherited): cancellation suppresses the toggle — the pet stays in its current sit / follow state.
Pet state: live pet, with the owner online.
Item: getItem() (inherited from PetInteractEvent)
always returns null for this event — the sit-toggle item is checked
by the caller, not stored on the event.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumThe state a sit toggle switches the pet into.Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetSitEvent(Pet pet, PetSitEvent.Action action) Creates the event for a pending sit / follow toggle. -
Method Summary
Modifier and TypeMethodDescriptionThe state the pet is being switched to.static HandlerListReturns the handler list for this event type.Methods inherited from class de.Keyle.MyPet.api.event.PetInteractEvent
getItem, getPetMethods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetSitEvent
Creates the event for a pending sit / follow toggle.- Parameters:
pet- the pet being toggledaction- the state it is being switched to
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetSitEventis dispatched through
-
getHandlers
- Overrides:
getHandlersin classPetInteractEvent
-
getAction
The state the pet is being switched to.- Returns:
- the state the pet is being switched to
-