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

$player->teleport(); >> world

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

Thread Status:
Not open for further replies.
  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 Slime

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

    Emirhan Akpınar Slime

    Messages:
    90
    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 Slime

    Messages:
    90
    Learn php.

    PHP:
    "cb1"
     
  6. Emirhan Akpınar

    Emirhan Akpınar Slime

    Messages:
    90
    World name must be string.
     
  7. Destroyer57

    Destroyer57 Zombie

    Messages:
    275
    $player->teleport($this->getServer()->getLevelbyName("cb1")->getSafeSpawn());
     
  8. Miauzer

    Miauzer Creeper

    Messages:
    1
    it should look like this
     

    Attached Files:

Thread Status:
Not open for further replies.
  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.