Interface HitBoxListener.OnDamage

Enclosing interface:
HitBoxListener

public static interface HitBoxListener.OnDamage
Functional interface for handling damage events.
Since:
1.15.2
  • Method Details

    • event

      boolean event(@NotNull @NotNull HitBox hitBox, @NotNull @NotNull ModelDamageSource source, double damage)
      Handles a damage event.
      Parameters:
      hitBox - the target hitbox
      source - the damage source
      damage - the damage amount
      Returns:
      true to cancel the damage, false otherwise
      Since:
      1.15.2
    • andThen

      @NotNull default @NotNull HitBoxListener.OnDamage andThen(@NotNull @NotNull HitBoxListener.OnDamage other)
      Chains this handler with another.
      Parameters:
      other - the other handler
      Returns:
      the combined handler
      Since:
      1.15.2