Posted May 20, 201510 yr I've been looking through the vanilla code, but I'm not finding how you get the respawn location. Or if it's easier, how would you use the vanilla respawn system to place the player upon re-entering the overworld from a custom dimension? (doing this inside my dimension's Teleporter class) I couldn't find where this is done on exiting the credits screen in the vanilla code.
May 21, 201510 yr ChunkCoordinates cc = player.getBedLocation(player.dimension); if (cc != null) { cc = EntityPlayer.verifyRespawnCoordinates(player.worldObj, cc, player.isSpawnForced(player.dimension)); } if (cc == null) { cc = player.worldObj.getSpawnPoint(); } That is the meat of the code adapted from ServerConfigurationManager#respawnPlayer. http://i.imgur.com/NdrFdld.png[/img]
May 21, 201510 yr Author I had to remove the verify section, with it in it was spawning me ~1000 blocks from the bed, but after I did that, everything worked great.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.