Load World

Discussion in 'Plugin Development' started by Muod, May 1, 2014.

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

    Muod

    I want to load a world that I can then TP to. Example, I have a world folder in my main directory called "Game", How would I then load Game so I can use it?
     
  2. Offline

    coasterman10

    Create a WorldCreator with the world's name and pass it to Bukkit.createWorld() (which returns the World object created in case you need to use it). Later, you can get it with Bukkit.getWorld(name).
    Code:java
    1. WorldCreator wc = new WorldCreator(/* world name */);
    2. World w = Bukkit.createWorld(wc);
     
  3. Offline

    Muod

    coasterman10
    Wont that create a new world rather than loading it?
     
  4. Offline

    coasterman10

    Muod If the world already exists it just loads it. If the world is already loaded it just returns the world.
     
Thread Status:
Not open for further replies.

Share This Page