Package de.Keyle.MyPet.api.skill
Interface OnHitSkill
public interface OnHitSkill
Interface for skills that trigger when the pet deals melee damage to a
target. The attack goal calls
trigger() to determine whether the skill
fires (often a random chance), then invokes apply(LivingEntity) to
execute the on-hit effect (e.g., Poison, Fire, Wither, Slow).
Called from PetMeleeAttackGoal#applyPetDamage in the plugin module.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidapply(LivingEntity target) Applies this skill's effect to the target that the pet just hit.booleantrigger()Determines whether this skill should fire for the current hit.
-
Method Details
-
trigger
boolean trigger()Determines whether this skill should fire for the current hit. Typically based on a random chance scaled by the skill's upgrade level.- Returns:
trueif the skill triggers;falseto skip
-
apply
Applies this skill's effect to the target that the pet just hit.- Parameters:
target- the living entity damaged by the pet
-