Closed naiski closed 3 years ago
Sorry for the late reply.
After investigating (thanks to @ustc-zzzz ), we find out that it's probably a vanilla bug, and here are the details about it:
setTrap(true)
which will add TriggerSkeletonTrapGoal
to the GoalSelector
GoalSelector
traverses its goals and call the tick
methodTriggerSkeletonTrapGoal
is being ticked and calls setTrap(false)
, which will remove itself from the GoalSelector
ConcurrentModificationException
The vanilla game doesn't run into this issue, probably because the TriggerSkeletonTrapGoal
is the last goal, so it doesn't matter. But here we added another, and the issue appears.
After all these investigations, I think your dirty fix is "robust" enough for this issue.
Thanks for the explanation!
Follow up, turns out this is a vanilla bug. See MinecraftForge/MinecraftForge#7509 for more info.
Summary:
When a skeleton horse trap event triggers the game crashes with a
ConcurrentModificationException
after adding a newTemptGoal
to theSkeletonHorseEntity
insideCrockPot.java:onAnimalAppear
.Steps to reproduce:
/summon skeleton_horse ~ ~ ~ {SkeletonTrap:1}
.Potential fix:
I was able to avoid this crash by modifying the logic at
CrockPot.java:102
and adding an extra check to ensure that the entity is not a skeleton horse:if (((animalEntity.getNavigator() instanceof GroundPathNavigator) || (animalEntity.getNavigator() instanceof FlyingPathNavigator)) && !(animalEntity instanceof SkeletonHorseEntity))
I'm not sure if this will cover all possible issues that might arise here but it seems to at least handle this particular problem with skeleton horse traps. Hopefully you can figure out a more robust fix.
Crash report:
crash-2020-09-28_02.14.52-server.txt