public function spawnToAll() { if ($this->chunk === null or $this->closed) { return; } foreach ($this->level->getChunkPlayers($this->chunk->getX(), $this->chunk->getZ()) as $player) { if ($player->isOnline()) { $this->spawnTo($player); } } }