if you want, you can plan when your server will restart and then with a TaskDelay you can use the method to transfer a player
isn't there a simpler method which will transfer players when the players are kicked for server restarting?
In a plugin's onDisable() method you can check if the server has stopped running. Combine this with transfering all players and you should get a good result. PHP: public function onDisable(): void{ // The onDisable() method inside the plugin's main class if(!$this->getServer()->isRunning()){ // Is the server running? foreach($this->getServer()->getOnlinePlayers() as $player){ // Loop through all online players $player->transfer($ip, $port); // Transfer each player to $ip:$port } }}