1. The forums will be archived and moved to a read only mode in about 2 weeks (mid march).

How to load worlds on startup with PMMP?

Discussion in 'Help' started by Lazer, Mar 26, 2017.

  1. Lazer

    Lazer Spider

    Messages:
    10
    GitHub:
    Lazerplayz
    How would I load worlds on startup using the option within pocketmine.yml?
     
  2. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    Under worlds: in pocketmine.yml

    2017-03-26_173946.png

    If you want to load a world called lazerisdumb, you do this:
    PHP:
    worlds:
      
    lazerisdumb: []
     
  3. Lazer

    Lazer Spider

    Messages:
    10
    GitHub:
    Lazerplayz
    Ofc thanks Lego x) and ofc Jack Noordhuis liked your reply!
     
    Legoboy0215 likes this.
  4. Legoboy0215

    Legoboy0215 Witch

    Messages:
    64
    GitHub:
    legoboy0215
    Forgot for a second who Jack was :rolleyes:
     
    jasonwynn10 likes this.
  5. MadScientist

    MadScientist Spider Jockey

    Messages:
    25
    If I have multiple worlds on the same server, how do I move between them?
     
  6. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    a plugin
     
  7. MadScientist

    MadScientist Spider Jockey

    Messages:
    25
    Thanks. Any suggestions for plugins that do this and will run on the latest build with API 3.0.0-ALPHA5?
     
  8. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  9. kaleb418

    kaleb418 Spider Jockey

    Messages:
    29
    GitHub:
    kaleb418
    PHP:
    if($commandName === 'chlevel'){
         if(
    $sender instanceof Player){
             if(
    count($args) === 1){
                 
    $worldName array_shift($args);
                 
    $level $this->getServer()->getLevelByName($worldName);
                 if(
    $level !== null){
                     
    $newLevel $this->getServer()->getLevelByName($worldName);
                     
    $sender->teleport(new Position($sender->getX(), $sender->getY(), $sender->getZ(), $newLevel));
                     
    $this->getServer()->getLogger()->info("§f{$sender->getName()} has gone to {$worldName}.§r");
                      
                     return 
    true;
                 }else{
                     
    $sender->sendMessage("§c{$worldName} does not exist.§r");
                  
                     return 
    true;
                 }
             }else{
                 return 
    false;
             }
         }else{
             
    $sender->sendMessage("§cCommand for players only.§r");
          
             return 
    true;
         }
    }
    Pop this into onCommand() in any plugin's main class.
     
  10. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
    Code isn't compatible on all plugins. This also isn't the development section.
     
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.