Package de.Keyle.MyPet.api.event
Class PetOnHitSkillEvent
java.lang.Object
org.bukkit.event.Event
de.Keyle.MyPet.api.event.PetEvent
de.Keyle.MyPet.api.event.CancellablePetEvent
de.Keyle.MyPet.api.event.PetOnHitSkillEvent
- All Implemented Interfaces:
Cancellable
Fired before a pet's on-hit skill executes against a living target. Dispatched
once per on-hit skill per strike — a pet with both Bleed and Fire on a
single mêlée swing fires the event twice in sequence.
Fires from PetSkillTriggerListener during the mêlée chain, after
PetDamageEvent (the damage step) and before each
OnHitSkill.apply(LivingEntity) call.
Cancellable: cancellation suppresses this specific on-hit skill;
other on-hit skills in the chain still run. To veto the entire strike,
cancel PetDamageEvent instead — that aborts the damage and the
full on-hit chain together.
Pet state: live pet, with the owner online. Skill is the live
OnHitSkill instance — listeners may call its accessors to read
upgrade levels but should not mutate state mid-strike.
Note: there is no symmetric event for active-skill dispatch.
Active skills run via the skill's own activate() flow without a
per-skill event hook today.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.bukkit.event.Event
Event.Result -
Constructor Summary
ConstructorsConstructorDescriptionPetOnHitSkillEvent(Pet pet, OnHitSkill skill, LivingEntity target) Creates the event for one on-hit skill in a mêlée strike. -
Method Summary
Modifier and TypeMethodDescriptionstatic HandlerListReturns the handler list for this event type.getPet()The pet whose skill is about to fire.getSkill()The live skill instance about to run.The entity the skill will be applied to.Methods inherited from class de.Keyle.MyPet.api.event.CancellablePetEvent
isCancelled, setCancelledMethods inherited from class org.bukkit.event.Event
callEvent, getEventName, isAsynchronous
-
Constructor Details
-
PetOnHitSkillEvent
Creates the event for one on-hit skill in a mêlée strike.- Parameters:
pet- the attacking petskill- the on-hit skill about to runtarget- the entity it will be applied to
-
-
Method Details
-
getHandlerList
Returns the handler list for this event type.- Returns:
- the shared
HandlerListeveryPetOnHitSkillEventis dispatched through
-
getHandlers
- Specified by:
getHandlersin classEvent
-
getPet
The pet whose skill is about to fire. -
getSkill
The live skill instance about to run. Safe to read for upgrade levels; do not mutate it mid-strike.- Returns:
- the on-hit skill about to run
-
getTarget
The entity the skill will be applied to.- Returns:
- the entity it will be applied to
-