Teleporting through different worlds.

Discussion in 'Plugin Development' started by X4X4, Dec 16, 2020.

Thread Status:
Not open for further replies.
  1. Offline

    X4X4

    I am trying to make it so when you run the command "/kit" it will teleport you to a different world. I have duplicated the world folder in my server folder and I think that's how you do it, but I am unsure.
    This is also my code:

    if (label.equalsIgnoreCase("kitpvp")) {
    p.teleport(new Location(Bukkit.getServer().getWorld("kit"),0,0,0));

    return true;
    }

    My problem is when I run the command I get an error "There was an internal error.".
    Any help would be appreciated!
     
  2. Offline

    timtower Administrator Administrator Moderator

    @X4X4 If you get that error then you should take a look at your server log, there it gives the error itself.
    You probably didn't load the world first. That is why it is giving issues.
     
  3. Offline

    X4X4

    How do I load the world though?

    nvm i got it working. that was the problem ty!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Dec 17, 2020
  4. Offline

    Ktilis

    p.teleport(new Location(Bukkit.getWorld("kit"),0,0,0));
     
Thread Status:
Not open for further replies.

Share This Page