That's another use of variables, local or global.
The easiest way is check if the array.at(X,Y) is where you want start to place the ore, also checking if the array.at(x,y) is bigger than the range wanted.
Checking it before start the events of placement, and configuring each placement method to place the desired tiles there is the easiest way.
So, you'll be able, for example, to make grass on the top tiles, while filled dirt blocks inside the ground, by checking their Y with the conditionals.