Teleport a player from one world to another?

Discussion in 'Plugin Development' started by Hello Minecraft World, Jan 17, 2012.

Thread Status:
Not open for further replies.
  1. I need to teleport a player from one world to another
    so i used a player respawn event but i can't find out how to teleport from one world to spawn in another
    i have a config so the string to get the world name would be confg.getString("Heaven")
    and for normal map config.getString("Normal Map")
    So my plugin won't make the other world they need will need a plugin like MultiVerse.
     
  2. Offline

    Kanlaki101

    Teleporting is based off of a Location.

    player.teleport(Location);
     
  3. Offline

    kevhog

    I believe a Location object contains X, Y, Z, pitch, yaw, and world; you can set its world with somelocation.setWorld(someworld)
    Or you can state it when you create a new Location, as the constructor goes Location(World world, double x, double y, double z)
     
  4. Location loc = event.getPlayer().getLocation();
    loc.setWorld(What should i have here?);
    as "world", world and config.getString("Normal Map") won't work?
     
  5. i don't think a string would work... i think you need Bukkit.getServer().getWorldByName(<name of world>); if you want to get the world by the name.
     
Thread Status:
Not open for further replies.

Share This Page