This is far easier than most people believe. No need for any events, simply Code: public function onDisable(){ if(!$this->getServer()->isRunning()){ //do things on server shutdown }else{ //reload, plugin disabled or server crashed } } in your PluginBase. Do note however that this will not work in the event of a server crash, as the server is still judged to be "running" if it did not shut down correctly.
so, I want to transfer the player to a different server when my server shut down but I don't know how to get the Player
That is a completely different topic to what dktapps has started. Please create that topic separately , as it helps for another user to search for the same issue as you.
public function onDisable(){ //ex( foreach($this->getServer()->getOnlinePlayers() as $p){ if(!$this->getServer()->isRunning()){ $p->sendMessage ("plugin error"); }else{ $p->sendMessage("good"); } }