Hey, I have a huge problem with teleport players to another world. A player is teleported to the right cords, however bad the world when you call out the teleportation teleport me to spawn world not test_world
can you post the getLocation method and whatever else ur doing with this, i dont think this is the best way to do this
Code: public String getLocation(Player player){ Location loc = player.getLocation(); String location = player.getWorld().getName() + "/" + (int) loc.getX() + "/" + (int) loc.getY() + "/" + (int) loc.getZ() + "/" + loc.getYaw() + "/" + loc.getPitch(); return location; } I'm not sure if it somehow works on teleportation players, but after each game finishing . World is restored from backup world (overwritten). In first game teleportation work perfect but after backup this teleport me to "spawn world"
Code:java public String getLocation(Player player){ Location loc = player.getLocation(); String location = player.getWorld().getName() + "/" + (int) loc.getX() + "/" + (int) loc.getY() + "/" + (int) loc.getZ() + "/" + loc.getYaw() + "/" + loc.getPitch(); return location;} Since getLocation(...) retrieves the world the player is currently in, make sure that world is test_world and not world. You might do better to hardcode "test_world" into the toLocation(...) method in lieu of using pos[0]...
Here's a way to debug: any time the target location is accessed, print the name of the world. If it's ever "world" and not "test_world", that's your issue - figure out where it's being set back to "world".
I don't think you have to store location as a string. This is how you store a location in config Code: Location location = player.getLocation(); config.set("World", player.getWorld().getName()); config.set("X", location.getX()); config.set("Y", location.getY()); config.set("Z", location.getZ()); config.set("Pitch", location.getPitch()); config.set("Yaw", location.getYaw()); saveConfig(); and to use it its like this Code: return new Location(Bukkit.getServer().getWorld(config.getString("World")), config.getDouble("X"), config.getDouble("Y"), config.getDouble("Z"), (float) config.getDouble("Yaw"), (float) config.getDouble("Pitch") );