I'm trying to make it so that when an effect is cleared from the player, a different effect is given to them instead (eg: if speed is cleared they get slowness instead). This works fine when using the /effect clear minecraft:speed command, but if I use the basic /effect clear command, it throws an error, saying that there is a concurrent modification exception. I assume this has to do with the fact that /effect clear is wiping the entire effect instance rather than just a single effect, and it doesn't like the fact that I am trying to add a new effect while it is still trying to clear the old effects. Does anyone know a way that I could get around this problem?