From f74c38f83dfe859ddd2900cf47efcecc1c04367d Mon Sep 17 00:00:00 2001 From: mathiascode Date: Tue, 21 Apr 2020 17:37:04 +0300 Subject: [PATCH] Actually remove effects on death --- .../java/pw/kaboom/extras/modules/player/PlayerDamage.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java b/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java index 4944513..eee3cd5 100644 --- a/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java +++ b/src/main/java/pw/kaboom/extras/modules/player/PlayerDamage.java @@ -14,6 +14,7 @@ import org.bukkit.event.entity.EntityRegainHealthEvent; import org.bukkit.event.entity.FoodLevelChangeEvent; import org.bukkit.event.entity.PlayerDeathEvent; import org.bukkit.inventory.ItemStack; +import org.bukkit.potion.PotionEffect; public final class PlayerDamage implements Listener { @EventHandler @@ -88,7 +89,10 @@ public final class PlayerDamage implements Listener { player.setFoodLevel(20); player.setFireTicks(0); player.setRemainingAir(player.getMaximumAir()); - player.getActivePotionEffects().clear(); + + for (PotionEffect effect : player.getActivePotionEffects()) { + player.removePotionEffect(effect.getType()); + } event.setCancelled(true); }