How could I teleport to a world? To teleport in some specific coordinates I used the code: PHP: $x = {x}; $y = {y}; $z = {z}; $player->teleport(new Vector3($x, $y, $z));
PHP: $x = {x};$y = {y};$z = {z};$level = $player->getServer()->getLevelByName("levelName");$player->teleport(new Position($x, $y, $z, $level)); EDIT: Fixed function call (thanks @Sandertv )
Small correction, $server->getLevel() requires a level ID parameter. To get a level from a name, you should use $server->getLevelByName($name)