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

Solved How to teleport to an other world?

Discussion in 'Development' started by MalakasPlayzMC, Apr 13, 2017.

  1. MalakasPlayzMC

    MalakasPlayzMC Spider Jockey

    Messages:
    37
    How to teleport to an other world? I know how to teleport to the same world with:

    PHP:
                $x 232;
                
    $y 4;
                
    $z 270;
                
    $player->teleport(new Vector3($x$y$z));
    But I want to teleport to an other world. Anyone who can help me?
     
  2. Primus

    Primus Zombie Pigman

    Messages:
    749
    PHP:
    $player->teleport($level->getSafeSpawn());
    $player->teleport(new Vector3($x$y$z));
     
  3. MalakasPlayzMC

    MalakasPlayzMC Spider Jockey

    Messages:
    37
    Thanks! But where could I put the world I want to tp?
     
  4. Sandertv

    Sandertv Zombie Pigman Poggit Reviewer

    Messages:
    786
    GitHub:
    Sandertv
    $player->teleport(new Position($x, $y, $z, $level));
     
  5. jasonwynn10

    jasonwynn10 Moderator Poggit Reviewer

    Messages:
    1,489
    GitHub:
    jasonwynn10
  6. Indexfire

    Indexfire Baby Zombie

    Messages:
    137
    GitHub:
    Indexfire
    PHP:
    $player->teleport(new Position(  $x  ,  $y  ,  $z  ,  $world));
     
  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.