I'm wondering what does that mean. y = playerHeight is probably starting number of for cycle. y > 0 can be condition, and y++ is increment by 1. If i'm right, this one checks y = playerHeight to infinity. Doesn't it ?
I'm not familiar with java though (it may not even be in java), i'm just curious.
And i'm pretty sure it scans wrong area. I tested it on bedrock level using single piece of ore. I noticed that when i scanned second time after miner finished working - it was never 0, never.