Waking up from a bed can cause the server to crash in specific circumstances
Title
The original title of this ticket was "Sleeping under the end portal crashes the game". It has been changed in order to prevent it from being leaked in the changelog.
The bug
If you sleep below an end portal, the server will crash if you wake up and are immediately teleported to the end (i.e., you're waking up inside of the portal blocks). This seems to be a regression of MC-120567.
To reproduce
- Find or build an end portal
- Activate it
- Place a bed one block below the portal
- Sleep in the bed
→
The server will crash as soon as you wake up
Video
Crash report
Description: Exception ticking world java.util.ConcurrentModificationException at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1380) at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512) at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502) at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:151) at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:174) at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234) at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:418) at vk.a(SourceFile:304) at net.minecraft.server.MinecraftServer.b(SourceFile:835) at net.minecraft.server.MinecraftServer.a(SourceFile:774) at eac.a(SourceFile:128) at net.minecraft.server.MinecraftServer.run(SourceFile:642) at java.lang.Thread.run(Thread.java:745)