Good afternoon,
I hope someone will be able to help me address this issue, its been driving me nuts.
I've been working on a little cross world teleport command. Not knowing how it was done, I started off by looking around in the existing minecraft/forge code to see what was available.
As a result I came across this method:
FMLCommonHandler.instance().getMinecraftServerInstance().getPlayerList().transferPlayerToDimension(EntityPlayer, DimID, Teleporter)
After creating my own extended version of Teleporter(copied into a spoiler below), I tried it out and it works... most of the time. When it works, it works great, no issues. However randomly it just kills the client/server with the following error:
Here is my reduced teleporter:
As you can see I've tried different methods of the actual movement of the player.
As I understand it, the error is due to a sudden change in a list that is being iterated over, however I don't have a clue on how to work around or resolve that.
Any help would be appreciated.
My target version of forge right now is: 1.12.2-14.23.0.2491