diff --git a/plugins/finale-paper/src/main/java/com/github/maxopoly/finale/listeners/PotionListener.java b/plugins/finale-paper/src/main/java/com/github/maxopoly/finale/listeners/PotionListener.java index 42a5b9b084..713fed6553 100644 --- a/plugins/finale-paper/src/main/java/com/github/maxopoly/finale/listeners/PotionListener.java +++ b/plugins/finale-paper/src/main/java/com/github/maxopoly/finale/listeners/PotionListener.java @@ -101,14 +101,14 @@ public void healthPotSplash(PotionSplashEvent e) { modifiedHealth += intensity * multiplier * (healingEffect.getAmplifier() + 1) * healthPerPotionLevel; - entity.setHealth(Math.min(maxHealth, modifiedHealth)); + if (!entity.isDead()) entity.setHealth(Math.min(maxHealth, modifiedHealth)); } } @EventHandler public void itemConsume(PlayerItemConsumeEvent e) { PotionModification potMod = getModification(e.getItem()); - if (potMod == null) { + if (potMod == null || e.getPlayer().isDead()) { return; } PotionMeta potMeta = (PotionMeta) e.getItem().getItemMeta(); @@ -141,7 +141,7 @@ public void potionSplash(PotionSplashEvent e) { ent.addPotionEffect(potEffect, false); }; for (LivingEntity ent : e.getAffectedEntities()) { - impact.accept(ent); + if (!ent.isDead()) impact.accept(ent); } }); }