PHP: $players = array();foreach($this->getServer()->getOnlinePlayers() as $player){ $players[] = $player->getName();}return $players; I think this should work?
PHP: $players = array_map(function($player){ return $player->getName();}, array_values($this->getServer()->getOnlinePlayers())); Haven't messed with php for a long time, but should work.