for (PotionEffect potionEffect : player.getActivePotionEffects()) {
player.removePotionEffect(potionEffect.getType());
}
Stacktrace:
[SEVERE] Exception while executing command: /effect SHADOWDAN_ clear
org.bukkit.command.CommandException: Unhandled exception executing 'effect SHADOWDAN_ clear' in net.glowstone.command.minecraft.EffectCommand(effect)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:161)
at net.glowstone.GlowServer.dispatchCommand(GlowServer.java:1903)
at net.glowstone.entity.GlowPlayer.lambda$chat$15(GlowPlayer.java:2286)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at net.glowstone.scheduler.GlowTask.run(GlowTask.java:144)
at net.glowstone.scheduler.GlowScheduler.pulse(GlowScheduler.java:196)
at net.glowstone.scheduler.GlowScheduler.lambda$start$0(GlowScheduler.java:122)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask.runAndReset(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$301(Unknown Source)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.util.ConcurrentModificationException
at java.util.HashMap$HashIterator.nextNode(Unknown Source)
at java.util.HashMap$ValueIterator.next(Unknown Source)
at java.util.Collections$UnmodifiableCollection$1.next(Unknown Source)
at net.glowstone.command.minecraft.EffectCommand.execute(EffectCommand.java:67)
at net.glowstone.command.minecraft.GlowVanillaCommand.execute(GlowVanillaCommand.java:155)
at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:151)
... 14 more
Glowstone commit: https://github.com/GlowstoneMC/Glowstone/commit/b3b6502f64772bdde3d397c29e5d4d0386c06836 If try remove all player effects and he already have more the 1 potion effect active
ConcurrentModificationException
throw. Can be reproduced with command/effect name clear
or codeStacktrace: