How do I make it if someone presses a FormApi button it teleports them to the "Default Spawn Level of a certain world" What code to I put into my "Case 0:" to make it teleport???
PHP: $f = function (Player $player, $data = null) { switch ($data) { case 0: $player->teleport($this->getServer()->getDefaultLevel()->getSpawn()); break; } }; Spoiler: Extra If I was you i'd use pmforms instead https://github.com/dktapps-pm-pl/pmforms/tree/master/src/dktapps/pmforms https://github.com/dktapps-pm-pl/pmforms-demo/tree/master/src/dktapps/pmforms_demo
Note: $player is the player variable PHP: $player->teleport($this->getServer()->getLevelByName("YourWorld")->getSafeSpawn());