From 4ff609e60c191f107682681b5e3a8262f8a4c844 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 26 Jun 2020 19:13:33 +1000 Subject: [PATCH] SPIGOT-5836: PotionEffect HEALTH_BOOST never expires --- src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java index f9867a5620..727906838b 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPlayer.java @@ -1526,10 +1526,13 @@ public class CraftPlayer extends CraftHumanEntity implements Player { } for (AttributeModifiable genericInstance : collection) { if (genericInstance.getAttribute() == GenericAttributes.MAX_HEALTH) { - genericInstance.setValue(scaledHealth ? healthScale : getMaxHealth()); + collection.remove(genericInstance); break; } } + AttributeModifiable dummy = new AttributeModifiable(GenericAttributes.MAX_HEALTH, (attribute) -> {}); + dummy.setValue(scaledHealth ? healthScale : getMaxHealth()); + collection.add(dummy); } @Override