From e7f363727e8fea0823d3377fec757dcbd1a467d8 Mon Sep 17 00:00:00 2001 From: Vidal Date: Fri, 13 Mar 2026 20:48:24 -0300 Subject: [PATCH] AbilityDefend event --- java/noppes/npcs/api/event/IAbilityEvent.java | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/java/noppes/npcs/api/event/IAbilityEvent.java b/java/noppes/npcs/api/event/IAbilityEvent.java index 75adaa4..cc2517e 100644 --- a/java/noppes/npcs/api/event/IAbilityEvent.java +++ b/java/noppes/npcs/api/event/IAbilityEvent.java @@ -171,4 +171,26 @@ public interface IAbilityEvent extends INpcEvent { */ int getTick(); } + + interface DefendEvent extends IAbilityEvent { + /** + * Get the entity that attacked during defend. + * @return the entity that was hit + */ + IEntityLivingBase getAttacker(); + + IEntityLivingBase getLastAttacker(); + + /** + * Get the damage amount. + * @return the damage amount + */ + float getDamage(); + + /** + * Set the damage amount. Allows scripts to modify damage. + * @param damage the new damage amount + */ + void setDamage(float damage); + } }