foreach($sender->getServer()->getOnlinePlayers() as $onlinePlayer) { $onlinePlayer->getInventory()->clearAll(); $onlinePlayer->getArmorInventory()->clearAll(); $onlinePlayer->getEffects()->clear(); $onlinePlayer->getEnderInventory()->clearAll(); $onlinePlayer->save(); $onlinePlayer->disconnect("Disconnected from server"); }