diff --git a/fabric/src/main/java/net/william278/husksync/data/FabricData.java b/fabric/src/main/java/net/william278/husksync/data/FabricData.java index 44a82a3e..5a126f3c 100644 --- a/fabric/src/main/java/net/william278/husksync/data/FabricData.java +++ b/fabric/src/main/java/net/william278/husksync/data/FabricData.java @@ -269,7 +269,8 @@ public abstract class FabricData implements Data { @Override public void apply(@NotNull FabricUser user, @NotNull FabricHuskSync plugin) throws IllegalStateException { final ServerPlayerEntity player = user.getPlayer(); - player.getActiveStatusEffects().forEach((effect, instance) -> player.removeStatusEffect(effect)); + List effectsToRemove = new ArrayList<>(player.getActiveStatusEffects().keySet()); + effectsToRemove.forEach(player::removeStatusEffect); getEffects().forEach(player::addStatusEffect); }