hello i want to make it that players are teleported to the world spawn point in a different level . I am doing this for a plugin (minigame) PHP: if($time == 480) { foreach($playersArena as $pl) { $pl->sendMessage("§e>§e--------------------------"); $pl->sendMessage("§e>§bDeathmatch is starting! 5 mintues untill the game ends!"); $pl->sendMessage("§e>§e--------------------------"); } $this->refillChests($levelArena); } if($time>=180) { $time2 = $time - 180; $minutes = $time2 / 60; where it is Deathmatch is starting is where i want to put it
Code: /** @var Level $level */ $level = Server::getInstance()->getLevelByName("YourWorld"); /** Player $player */ $player->teleport($level->getSafeSpawn());