$player->teleport(); >> world

Discussion in 'Development' started by b3st_Thunder78, Jul 13, 2019.

  1. b3st_Thunder78

    b3st_Thunder78 Spider Jockey

    Messages:
    38
    Hello,
    How can you teleport to another world, so with your own command, that you do / tpcb and then get teleported to the world cb1? how does it work how to build that in the
    PHP:
    $player->teleport();
    .
     
  2. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    PHP:
    $player->teleport(new Position(xyzServer::getInstance()->getLevelByName(worldName)));
     
  3. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    Dont forget add

    PHP:
    use pocketmine\Server;
    use 
    pocketmine\level\Position;
     
  4. b3st_Thunder78

    b3st_Thunder78 Spider Jockey

    Messages:
    38
    does not work[​IMG]
     
  5. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    Learn php.

    PHP:
    "cb1"
     
  6. Emirhan Akpınar

    Emirhan Akpınar Witch

    Messages:
    63
    GitHub:
    EmirhanWSD
    World name must be string.
     
  7. Destroyer57

    Destroyer57 Zombie

    Messages:
    269
    $player->teleport($this->getServer()->getLevelbyName("cb1")->getSafeSpawn());
     

Share This Page

  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.