From 75b01759693b132ca044c225eb26191359365e42 Mon Sep 17 00:00:00 2001 From: Grzybol Date: Thu, 27 Jun 2024 01:16:10 +0200 Subject: [PATCH] - fix --- src/main/java/betterbox/mine/game/betterelo/Event.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/betterbox/mine/game/betterelo/Event.java b/src/main/java/betterbox/mine/game/betterelo/Event.java index c3bd3e8..c011986 100644 --- a/src/main/java/betterbox/mine/game/betterelo/Event.java +++ b/src/main/java/betterbox/mine/game/betterelo/Event.java @@ -1191,8 +1191,11 @@ public void customEntityDamageEvent(EntityDamageByEntityEvent event){ defense=0; } } + double finalDamage =((totalDamage-armor)*(1-(0.01*defense))); + if(finalDamage<=0) + finalDamage=0; - event.setDamage((totalDamage-armor)*(1-(0.01*defense))); + event.setDamage(finalDamage); pluginLogger.log(PluginLogger.LogLevel.CUSTOM_MOBS, "Event.customEntityDamageEvent totalDamage: " + totalDamage+", bonusDamage: "+bonusDamage); return;