Ore (feature)

A mineral vein is a terrain feature consisting of a natural deposit of ores or other blocks in the ground.

Generation
Players can come across these veins in caverns or anywhere where there is natural stone. Underground deposits of dirt and gravel are generated in this step, followed by the more precious ores: coal, iron, gold, redstone, diamond, emerald (in mountains biomes) and lapis lazuli. They can form only in stone, andesite, diorite and granite, and do not replace each other or any other block. Note that two or more mineral veins can form next to each other and make it look like a mineral vein made of more than one material.

The generation of ore veins utilises 32-bit floating point numbers, rather than 64-bit. While this does not cause issues within the vanilla bounds of the game, were the player to generate terrain between 2^26 and 2^27 blocks, generation of ore veins would lose precision in such a way that would cause millions of chunks to attempt to load, resulting in a game crash.