Minecraft – How to calculate the optimum mining height

minecraft-java-edition

Is there a formula that could be used to determine the optimum mining height if arbitrary values are inputted for each mineral? Assume a 1×2 tunnel is being constructed and ignore potential disruptions (we care only about theoretical). The formula should look something like this:
V(Y)=equation.
Where V(Y) is the total value when a tunnel is dug at that y-value. Inputs to the equation should be D,R,L,G,I, representing whatever arbitrary values the user wishes to input for each ore.

This equation would be used to determine which Y-value is optimal for that specific user's needs. Therefore, it is not necessary that it calculate some kind of "accurate" value, only that the relative outputs at each Y value be representative of the relative value of the ores. Please include an explanation of the formula, with citations for any ore distribution information.

Best Answer

I don't think there is any way to create such an equation because of how distributions occur. Take for example diamond ore and iron ore. Diamond ore spawns on level 1 through 15, and is about evenly distributed across those levels, while iron ore spawns from 1 to 63 but is most concentrated 5 to 40. Similarily Gold Ore is evenly distributed from 2 to 29. Looking at how these materials are distributed, as long as you are in the sweet spot of level 5 to 16 for finding diamond, you also happen to be in the sweet spot for all other minerals. So mining around level 8 or 10 should get you the maximum yield for your effort.

The only other thing to take into account is lava which can "overwrite" minerals when the generator places it, lowering yield per chunk. Lava spawns in the same levels as diamond, so if you don't care to get diamonds, then mining in layers 17 to 29 will get you the highest yield for non-diamond minerals, but you cannot find diamonds at that height.

Because of how Mojang set up the generator there is no real need for an equation; just decide whether or not you want diamonds. If you want diamonds, mine at level 10 or so, if you want to get more iron/gold/redstone at the cost of diamonds then mine around level 20 or so. By the way, you can see what levels minerals spawn at on their wiki pages here.