mirror of
https://github.com/kaboomserver/extras.git
synced 2024-11-27 09:55:36 -05:00
Actually remove effects on death
This commit is contained in:
parent
6fe4e56a7f
commit
f74c38f83d
1 changed files with 5 additions and 1 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue