PHP: #$level instanceof Levelforeach($level->getEntities() as $entity){$entity->getId();//Store it if you want} https://github.com/pmmp/PocketMine-MP/blob/master/src/pocketmine/level/Level.php#L1888-L1890