In 1.18, there is no longer a single small range of Y levels that will get you near-best numbers for all those wanted ores. The ore generation is spread out enough that you'll need to venture to different Y levels to get the most of any given resource.
The Short Version
In the ranges given below, the first/lower number should be the Y level beneath your feet and the last/higher number the Y level above your head. The Y coordinate of you, the player, would be the lower number + 1. (See the following section on "Mining Technique" for more details.)
- Coal is now best found exposed on the surface or in mountainsides, rather than in a mine. If you insist on mining for it, dig just below the dirt where stone begins generating.
- Iron's best range is 13 through 16.
- Lapis is mined most efficiently at levels 7 through 10, even though there is technically more of it just below Y 0.
- Gold is best mined at -20 through -17 according to my data. Some sources suggest the range -18 through -15 might be better, and would have slightly less lava.
- Diamond can be found most abundantly at levels -59 through -56, but so can an awful lot of lava. You can almost completely avoid lava and still find ~89% as many diamonds by using levels -54 through -51.
While the best Y levels for mining may have changed, the most efficient technique for mining at a given level has not changed. It is the same as explained in the previous answer for 1.16. This video also does a great job showing and explaining it.
The main takeaway is that the most efficient way to mine at a given level is with the smallest possible shaft: a two-tall, one-wide tunnel. This will expose four Y levels, the two you're mining through, the one below your feet and the one above your head. So when you pick "a Y level" to mine at, you're actually picking four contiguous levels, and the amount of ore you get is the sum of all four of those levels.
Note that, because you're actually exposing more of the two inner levels (the ones you're actually mining through), you get three times the ore from those two levels compared the the ones above and below you. So if you're hunting an ore that generates in a triangular distribution (see "The Official Ore Distribution Chart" section below) you'll want the tip of that triangle to be at one of those two inner levels you're mining.
Graphs, Data & Explanation
Below are the graphs and data I used as sources for my answer, as well more in-depth explanations as to why each level is the best for each resource.
The Official Ore Distribution Chart
This is one of the most helpful resources. It was published by someone from the Minecraft team and shows how the game attempts to generate each type of ore. Aside from "ore veins", a given ore is either generated in a "rectangle" distribution (meaning the ore generates in the same quantities anywhere between the top and bottom of the shape), a "triangle" distribution (meaning there is a single Y level where that ore is most common, and it becomes gradually less common as you move up or down from that level), or both.
Iron, for example, has three different generation patterns, all happening at once:
- An even, "rectangle" generation from the bottom of the world up to around Y 72.
- An underground triangular pattern centered at about Y 16.
- A second triangular pattern up high, centered around Y 232.
The actual generation of iron in a world is the sum of all these generation patterns. The same goes for the other ores.
Note that ores only actually generate in stone (and other similar blocks), so while some ores, like iron and coal, have a very high chance of generating up high, since there is very little terrain up there for them to generate in, there isn't as much up there as you can find lower down. This can be seen in my analysis graphs below. But it is worth noting that the terrain that you do find that high (mountains) will have a large concentration of those ores.
Using my own tools (the same ones I used for the 1.16 analysis answer), I listed out the locations of every ore block from three random 1.18 worlds. The total area analyzed was 16,214 chunks, just over 4 million blocks per Y level. The actual worlds analyzed, the raw data extracted, as well as the source code for the tool I created and used to generate this data, is available and linked at the end of this answer.
Full graph of ore distribution (open separately or download to see in detail)
The first graph gives you a broad picture, much like the official chart. Note that lava is scaled separately, because there is much more lava deep down than any one ore. All other ores are scaled together.
You can see very clearly by looking at coal how the triangular and rectangular distributions combine starting at about Y 135. You can also see how the higher end of the triangular distribution drops more unevenly than the lower end, this is because it reaches up past the surface of the world, where there's often less stone to generate in.
Ore generation up through Y 16
This graph is the same as the previous, but gives a closer look at the ores that generate deeper down, without having to accommodate for the high peaks of coal and copper. Lava is still scaled separately. It's not quite focused enough to give you an easy look at diamond, but it does provide a better look at lapis, gold and the increase in lava that seems to occur between about -43 and -17.
Diamond, gold, lapis, iron and lava below Y -46
My final graph provides a close-up of the deepest levels. Coal and copper are non-existent this deep. Redstone is left off the graph because it's on the "do not care" list in the original question, and to make it easier to see the remaining ores. Lava is still scaled separately.
Because the peak of the main coal generation triangle is just about at the surface level of the world, rather than mining for coal at all, I'd suggest just looking for exposed coal ore on the surface of the world, especially on mountainsides if any are nearby. If you need to find even more coal, dig just under the dirt layer of the world. My graph shows Y 58 and lower, down to the mid 40s, to be the best levels for mining coal.
I'll mostly ignore copper, since it's not mentioned in the original question. It's found most commonly slightly below coal in the low Y 40s.
My graph shows a relatively stable amount of iron in the higher areas of the world, probably because the dwindling amount of stone and the growing odds of generation balance each other out as you go higher. Regardless, it's nothing compared to the mountain of iron burred underground.
My graph shows that the best level for iron is Y 14. This lines up pretty closely with the official ore generation chart, showing the peak of the main triangle generation to be close to Y 16. The Minecraft Wiki says iron ore is "most common around level 15".
Taking all that into account, I'd recommend mining at levels Y 13, 14, 15 and 16 for iron. With 14 and 15 being the levels you're actually mining through (giving you the 3x bonus on both), 13 below your feet and 16 above your head.
With lapis, things get a little interesting, as there is an extra factor to consider.
My graphs shows that lapis is most common at Y -2 (though the neighboring levels are very close). This lines up very well with the official chart, which shows lapis peaking somewhere around Y 0. The Minecraft Wiki says it is "most common around level -1".
However, just because it is most common at one of these levels does not mean that is the level where you will find it most efficiently. This is because deepslate begins to generate instead of stone at Y 7, completely replacing stone by Y 0. This is important because deepslate takes twice as long to mine as stone. So even though there is more lapis just below 0, it takes twice as long to reach as the lapis above 7, meaning you have to spend twice as long mining to get it, effectively giving you half as much lapis per unit of time. Couple this with the very small triangular distribution, and it actually becomes more efficient to mine lapis above deepslate levels.
Frequency of lapis ore adjusted by mining time
The dotted, "adjusted" line accounts for the fact that you're mining twice as fast above 7 compared to 0 and below, so you'd be finding lapis at 2x the speed. (It assumes that deepslate replaces stone at an even rate between those levels, but that shouldn't affect the result.)
Looking at things this way, it's clear that the best Y levels to mine lapis are 7, 8, 9 and 10 (with 8 and 9 being the levels you actually dig through, 7- where the deepslate starts- below your feet and 10 above your head).
My graph shows the best level for goal to be Y -19. This is lines up somewhat closely with the official chart, which shows the peak of the triangle generation to be somewhere around Y -16 (looking at the image of the official chart, it's hard to tell exactly). The Minecraft Wiki says gold ore is most common "around layer -16".
Given the size of the triangle distribution, none of these potential peaks are quite close enough to take advantage of the x2 mining speed available above Y 7, so unlike lapis, gold is still best mined below 0. (Here's the graph showing this if you're interested.)
Seeing as both the official chart and the wiki only give approximate Y levels, and as I'm biased to follow my own data, I'm going to suggest mining at Y levels -20, -19, -18 and -17 is best for gold (with -19 and -18 being the levels you actually dig through for the 3x bonus, -20 below you and -17 above).
You could be justified at mining two blocks higher, if you want to focus on Y -16 as indicated by the official chart and the wiki. This might also help you avoid some lava, which my graph shows as getting more common gradually starting at Y -18.
All sources agree that diamond gets more and more common the deeper you get. That is true until you start hitting bedrock which, judging by my graph, seems to start at Y -60, leaving Y -59 as the Y level where diamonds are most common.
The mining levels that will get you the most diamonds are Y -59, Y -58, Y -57 and Y -56 (with -58 and -57 being the levels you're actually mining through, -59 being below you and -56 being above you). Normally, since -59 has the most diamond, we'd want to have it be one of our two inner levels, but Y -60 has so much less diamond that it is actually less efficient to shift down one level.
The above conclusion is also reached in this YouTube video, where someone else conducted a similar test on diamond ore using a different method.
There is one other thing to consider, though: lava. Huge lava lakes start at Y -55, meaning the entirety of that ideal diamond range is at a depth where you're quite likely to get interrupted by a wall of death. Stopping to go around or through lava, or to make a new branch, takes time, not to mention it's dangerous.
If you want the most diamonds possible while avoiding lava, the best Y levels for mining are -54, -53, -52 and -51 (with -53 and -52 being the levels you dig through, -51 above you, and -54 below you with lava lakes starting one level deeper). Going off the numbers from my analysis, using these Y levels will get you about 89% as many diamonds as using the optimal levels. That's about 8 out of 9, meaning for every 8 diamonds you find, you would have found 1 more digging at optimal depth.
My Tools (Performing Your Own Analysis)
In my continuing effort to stay scientific about all this, just like with the previous 1.16 answer, I'm releasing everything I used in this new analysis for public use. This includes:
- The program I wrote to analyze Minecraft worlds, now updated to work for 1.16, 1.17 and 1.18 (1.18 only tested for Java Edition). Available on GitHub.
- All three of the actual world files I analyzed to get the data used in the above answer.
Included in the GitHub repo, but here are the direct links:
- The raw data I extracted from those worlds, used to make the graphs in this answer.
Also included in the GitHub repo, but here are the direct links:
With these tools, not only can you reanalyze my data to find anything I might have missed, but you are more than welcome to create your own Minecraft worlds and analyze those to see if there are unexpected differences.