[SPIGOT-5848] PlayerSpawnLocationEvent throws NPE when setting a location of another world Created: 26/Jun/20  Updated: 26/Jun/20  Resolved: 26/Jun/20

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: CodingAir Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.16.1, Freezing, PlayerSpawnLocationEvent
Environment:
  • local windows server

Shouldn't be important for that bug (please ask for further information if required)


Attachments: File SpigotHubTest.jar    
Version: git-Spigot-758abbe-38de0b8 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

After joining the server, triggering the PlayerSpawnLocationEvent and a plugin tries to set the spawn to a location in another world, the server throws this exception and every entity freezes for the player, who have to rejoin now. In fact that the player switches to the world before the error comes up, he is in the correct world and everything works fine.

 

This bug does not appear on a Spigot-v1.15.2 server.

A test plugin is attached.

 

Thank you for getting into this bug report!

 

NullPointerException:

Error executing task on Server
java.lang.NullPointerException: null
 at net.minecraft.server.v1_16_R1.ChunkMapDistance.b(ChunkMapDistance.java:244) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.PlayerChunkMap.movePlayer(PlayerChunkMap.java:956) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.ChunkProviderServer.movePlayer(ChunkProviderServer.java:482) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.PlayerConnection.a(PlayerConnection.java:479) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.PacketPlayInTeleportAccept.a(SourceFile:30) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.PacketPlayInTeleportAccept.a(SourceFile:8) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.TickTask.run(SourceFile:18) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeTask(SourceFile:144) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.executeNext(SourceFile:118) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.MinecraftServer.aZ(MinecraftServer.java:941) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.MinecraftServer.executeNext(MinecraftServer.java:934) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.IAsyncTaskHandler.awaitTasks(SourceFile:127) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.MinecraftServer.sleepForTick(MinecraftServer.java:918) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.MinecraftServer.v(MinecraftServer.java:850) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at net.minecraft.server.v1_16_R1.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot-1.16.1.jar:git-Spigot-758abbe-38de0b8]
 at java.lang.Thread.run(Unknown Source) [?:1.8.0_231]

 

 


Generated at Tue Apr 15 09:41:36 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.