diff --git a/src/pocketmine/player/Player.php b/src/pocketmine/player/Player.php index 9429e51c5..066718122 100644 --- a/src/pocketmine/player/Player.php +++ b/src/pocketmine/player/Player.php @@ -866,7 +866,7 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, $world = $world ?? $this->world; $index = World::chunkHash($x, $z); if(isset($this->usedChunks[$index])){ - foreach($this->getWorld()->getChunkEntities($x, $z) as $entity){ + foreach($world->getChunkEntities($x, $z) as $entity){ if($entity !== $this){ $entity->despawnFrom($this); }