Custom World Names upon Load

Discussion in 'Plugin Development' started by zanginator, Feb 8, 2014.

Thread Status:
Not open for further replies.
  1. Hi everyone, hoping someone can help with this.

    So what I am doing is using the world create options to load a world for temporary use and then close it afterwards (without saving).

    So I have the custom world load and unload working, however, what I want to do is be able to have multiple instances of one map running (for example adventure maps)

    So for instance, I load world "test" but I want to prefix or suffix it with the player name. So I am loading "test" for example, except I want it to be loaded as "player_test" or "test_player".

    Code:java
    1. if(commandLabel.equalsIgnoreCase("instance_test")) {
    2. World test = Bukkit.getWorld("test");
    3. if(test == null){
    4. player.sendMessage(ChatColor.GREEN + "Loading world, please standby.");
    5. WorldCreator creator = new WorldCreator("test");
    6. creator.environment(World.Environment.NORMAL);
    7. creator.generateStructures(false);
    8. test = creator.createWorld();
    9. player.teleport(test.getSpawnLocation());
    10. }
    11. else
    12. {
    13. player.teleport(test.getSpawnLocation());
    14. }
    15. }


    So that's how I am doing it so far. How can I get it to act as I wish?
    Thanks in advance :D

    (Pssst, Also if anyone knows how to spawn an entity (eg a Villager) and keep them in one spot (prevent just them moving), can you please tell me :p)
     
Thread Status:
Not open for further replies.

Share This Page