$entity->getBlocksAround(). But you will then recalculate the blocks, if you might be trying to do that. The best solution is to let PocketMine add the collided block in ProjectileHitEvent.