Hello. I have a problem, I have a problem with changing the world. I wanted all players to be teleported to another world when the timer expired. The problem is that some players crash more often. Do any of you know how I can fix this? PHP: if($timeStart<=0) { $timeStart=0; $map = $config->get($arena . "Map1"); $this->plugin->getServer()->loadLevel($map); $spawn = $this->plugin->getServer()->getLevelByName($map)->getSafeSpawn(); $level->loadChunk($spawn->getFloorX(), $spawn->getFloorZ()); $this->plugin->getServer()->getLevelByName($map)->loadChunk($this->plugin->getServer()->getLevelByName($map)->getSafeSpawn()->getFloorX(), $this->plugin->getServer()->getLevelByName($map)->getSafeSpawn()->getFloorZ()); foreach($playersIn as $player) { $player->addTitle(TextFormat::GREEN . $map, $this->messages->get("ingame.goodluck")); $player->teleport($this->plugin->getServer()->getLevelByName($map)->getSafeSpawn()); } }
Why teleport the player twice? Just using the second line of code should work. Aside from that, I would guess the issue is relevant to the map itself. Does this ever happen when players teleport to other levels through other means?
Oh, that was a mistake on my part. In my code it is only teleported once. Corrected the line in question. Still, it doesn't change the current situation.