Custom world generation

Custom world generation allows data packs to change how the world generate.
== World Preset and Dimension ==
A world preset controls what dimensions a world has. Before 1.19 (22w11a), dimensions are defined in dimension folder rather than in world preset. Although in current version the world preset is recommended, the dimension folder is still supported.
World preset or dimension define what generator (noise, debug or superflat) is used in a dimension. If it is noise, they define what noise settings and biomes are used and how the biomes are placed.
== Noise settings ==
Noise settings are for generating the shape of the terrain and noise caves, and what blocks the terrain is generated with, stored as JSON files within a data pack in the path , and are used with the generator in a dimension. Vanilla settings include for normal Overworld generation, for Amplified Overworld generation, for regular Nether generation, for Cave (Nether-like generation but with Overworld terrain features) generation, for regular End generation, and for Floating Islands (similar to The End outer islands) generation.
During terrain generation, block position where the final density value is less than zero become air and will be filled by the aquifer, and the position where the value is greater than zero become the default block and will be filled with the surface rule.
When applying surface rule, noise is used to calculate the thickness of the surface layer. is calculated at each horizonal coordinates, and the surface layer thickness fluctuates from this value by ±0.25 affected by random numbers based on the coordinates. This noise and actual surface layer are used in vanilla surface rule, for example, to determine the total thickness of dirt and grass block in the plains.
=== JSON format ===
* : Root object.
=== Density Function and Noise ===
A density function providers position-dependent values for noise router.
=== Noise ===
A noise can be referenced by a density function and surface rule. It is stored as JSON files within a data pack in the path data/<namespace>/worldgen/noise.
In addition to being called by density functions and surface rules, there are also some noises with hard-coded usage:
* : Affects the surface layer thickness in surface rule.
* : Used as the thickness of additional surface layer in surface rule.
* : Used to generate badland terracotta bands in surface rule.
* , , : Used when generating badland hoodoos in biome.
* , , : Used when generating iceberg terrain feature in and biomes.
==== JSON format of Noise ====
* : Root object.
== Biome ==
A biome is a region in a dimension with distinct features, carvers, climates, spawned mobs, ambient sound and music, and sky, water, grass and foliage colors, stored as JSON files within a data pack in the path .
== Carver ==
Carvers are used to add carver caves and canyons. Note that noise caves are generated by noise settings.
== Feature ==
Features are small decorations that can at most write to a 3x3 chunk area centered on the placement chunk. They're locally placed per chunk and cannot be searched for using commands. Examples are trees, flowers, ore, etc.
== Structure ==
Structures are large decorations that can write to a much larger area than the 3x3 chunks of a feature. They're placed globally and spaced out in a randomized grid (or in concentric rings for strongholds), and can be scanned for and found using . Structures can affect terrain generation. 
== Surface builder ==
Surface builders were used to control how the surface of the terrain is shaped and what blocks it is generated with. They are stored as JSON files within a data pack in the path .
== History ==
== External links ==
* A list of all worldgen files for each Minecraft version before 1.19.3 (22w42a)
* How to add a custom structure to the world
== Notes ==
de:Angepasste Weltgenerierung
ja:カスタムワールド生成
pt:Geração de mundo personalizado
zh:自定义世界生成