Skip to content

Instantly share code, notes, and snippets.

@perky
Last active March 16, 2019 22:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save perky/4413516 to your computer and use it in GitHub Desktop.
Save perky/4413516 to your computer and use it in GitHub Desktop.
Caused by: java.util.ConcurrentModificationException at java.util.HashMap$HashIterator.remove(Unknown Source) Line 9: potionKey.remove();
private void cureAllPotions(World world, EntityPlayer entityPlayer) {
List<PotionEffect> activePotions = new ArrayList(entityPlayer.getActivePotionEffects());
for(PotionEffect potionEffect : activePotions) {
entityPlayer.removePotionEffect(potionEffect.getPotionID());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment