Check out example codes for "spigot respawn player location". It will help you in understanding the concepts better.

Code Example 1

@EventHandler
public void playerRespawn(PlayerRespawnEvent e) {
	e.setRespawnLocation(new Location(world, x, y, z, yaw, pitch));
}

Learn ReactJs, React Native from akashmittal.com