Interface OnHitSkill

All Known Subinterfaces:
Bleed, Fire, Knockback, Lightning, Poison, Slow, Stomp, Wither

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 Type
    Method
    Description
    void
    Applies this skill's effect to the target that the pet just hit.
    boolean
    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:
      true if the skill triggers; false to skip
    • apply

      void apply(LivingEntity target)
      Applies this skill's effect to the target that the pet just hit.
      Parameters:
      target - the living entity damaged by the pet