"China, the world’s largest coal consumer, has domestic reserves of coal to last the next 50 years, according to annual reserves data from the Ministry of Natural Resources cited by Bloomberg.
At current rates of domestic production, China also has crude oil reserves that could last for at least 18 more years, according to the ministry"
https://oilprice.com/Latest-Energy-News/World-News/China-Say...
https://www.mining.com/web/china-has-enough-coal-reserves-to...
I have a habit of thinking about history in very long terms, and that just does not sit right with me. That kind of thinking (oh we have enough for decades, let it rip!) happens, and the decades pass, and time inevitably is less kind to the descendants of such decision makers.
(incidentally the latest such shock was sometime this decade when I learnt that an aquifer could not only be depleted, but that that depletion would compact the soil so that it would thereafter be unable to hold water, and thus never (at least on our timescales) be able to be replenished. I think I'm still not over that!)
In historical terms, it took about 60 milion years to form this coal layers. Humanity will burn them in few centuries.
https://en.wikipedia.org/wiki/Carboniferous
From the point of view of energy. The conversion of solar energy into coal is very inefficient, tree need energy to reproduce, only a part of plant is converted into coal, other organisms consuming plant matter, etc.