ConcurrentModificationException from scoreboard conditions or modification mechanics
(Content copied from premium ticket #371) Hello, I have noticed a problem regarding modifying scoreboard values with mythicmobs causing ConcurrentModificationException
Error Snip: https://pastebin.com/VLTPzvEG
TL;DR: The mechanic works successfully, most of the time. The error happens sometimes when trying to modify scoreboard many times at once.
My server tampers a lot with the scoreboard for specific reasons and it has been working very well so far, however, this error seems to has been popping up over the place randomly and occassionally. I decided to tackle it today. After a bit of playing around, it seems to be somewhat consistently reproducable by having multiple processes modify the scoreboard at once. Even then, the error seems to only pops up sometimes. However, it seems to also cause the mechanic to fail to function as well, leading to some issues, though rarely seen due to the nature of the bug.
Reproduction Steps
- Get this guy on your server https://pastebin.com/VXBmDi8z
- /mm reload or just restart per usual.
- spawn lots of him at once, the more, the better (My server only takes 10 to raise the error due to other background process, a fresh server may take spawning a hundred or more to cause issue.)
- see the console.
This is a snip of my console log when I spam command to spawn them. https://pastebin.com/JgBg1Ds9 The error happens instantly sometimes when spawning them as you see.
Versions Paper 1.16.5, MythicMobs build 3555. Issue has been present since I started using it in 4.9.
Intended Behaviour Scoreboard modifications and conditions should not cause such error at all.
Would love to see it fixed, if possible. Thank you!