How stardust-labs-mc/terralith works
Purpose and Runtime
This is a Minecraft Java Edition data pack for Terralith-style Overworld world generation. It is declarative: JSON registries and NBT structure templates are loaded by Minecraft’s data-pack runtime, not application code. The pack root is pack.mcmeta; the primary loaded namespace is data/terralith/, alongside overrides/extensions in data/minecraft/, data/c/, and data/forge/.
Entry Points and Versioning
Minecraft loads registries from the data-pack layout, with the Overworld definition as a central entry point: data/minecraft/dimension/overworld.json. Runtime initialization also registers Terralith functions through data/minecraft/tags/functions/load.json, leading to functions such as data/terralith/functions/setup.mcfunction.
Version-specific overlay roots provide targeted registry replacements/additions for Minecraft 1.20.2, 1.20.3, and 1.20.5: 1-20-2-overlay/, 1-20-3-overlay/, and 1-20-5-overlay/. They must remain compatible with the base registry identifiers they replace.
Terrain-Shaping Pipeline
Base terrain is controlled by Minecraft noise settings and density functions, overridden or augmented in two namespaces:
• Vanilla Overworld routing: data/minecraft/worldgen/noise_settings/overworld.json, data/minecraft/worldgen/density_function/overworld/noise_router/final_density.json.
• Terralith terrain forms: data/terralith/worldgen/density_function/overworld/extra_terrain_sum.json, data/terralith/worldgen/density_function/overworld/cliff/spline.json, and data/terralith/worldgen/density_function/overworld/special/crater_explosion.json.
The effective flow is noise/density sampling → terrain volume and aquifer decisions → surface/biome-specific decoration. Density-function references are a critical identifier boundary: renaming files changes registry IDs and breaks consumers.
Biomes, Classification, and Features
Biome definitions select climate, effects, generation settings, carvers, and placed features. Core biome catalogues reside in data/terralith/worldgen/biome/, for example data/terralith/worldgen/biome/skylands.json and data/terralith/worldgen/biome/cave/frostfire_caves.json; selected vanilla biome definitions are overridden under data/minecraft/worldgen/biome/.
Decoration is split into:
1. Configured features describing what generates, e.g. data/terralith/worldgen/configured_feature/skylands/island.json.
2. Placed features defining placement/modifiers, e.g. data/terralith/worldgen/placed_feature/skylands/floating_islands.json.
Biome JSONs consume placed-feature IDs, which in turn consume configured-feature IDs. This is the dominant dependency graph.
Carvers, Noise, and Surface Detail
Carvers alter terrain before/alongside decoration: data/terralith/worldgen/configured_carver/deep_ravine.json and data/minecraft/worldgen/configured_carver/canyon.json. Custom noise parameter registries support biome and cave surface patterns, such as data/terralith/worldgen/noise/cave/thermal/magma.json and data/terralith/worldgen/noise/highlands/creek.json.
Block and biome tags provide reusable compatibility/classification boundaries for features and external mod ecosystems: data/terralith/tags/blocks/volcano_blocks.json, data/c/tags/worldgen/biome/mountain.json, and data/forge/tags/worldgen/biome/is_mountain.json.
Structures and Loot Integration
Structures are composed through structure definitions, placement sets, template pools, processor lists, and NBT templates:
• Registration/placement: data/terralith/worldgen/structure/fortified_village.json, data/terralith/worldgen/structure_set/rare_village.json.
• Jigsaw composition: data/terralith/worldgen/template_pool/village/fortified/starts.json, data/terralith/worldgen/processor_list/village/fortified/road.json.
• Physical templates: data/terralith/structures/village/fortified/start_castle.nbt.
Structure biome eligibility is mediated by tags such as data/terralith/tags/worldgen/biome/has_structure/fortified_village.json. Generated containers resolve Terralith loot tables, for example data/terralith/loot_tables/village/fortified/treasure.json. No network services or deployment infrastructure are present; Minecraft’s data-pack loader is the only material runtime dependency.
Main entry points: skylands.json Terralith biome catalog · overworld.json Overworld noise settings · fortified_village.json Fortified village structure · starts.json Fortified village pool
Components 22
Data-pack Runtime
Minecraft loads declarative registries and functions.
- Minecraft data-pack loader · The sole material runtime dependency.
pack.mcmeta - Overworld definition · Central Overworld world-generation entry point.
data/minecraft/dimension/overworld.json - Load function tag
data/minecraft/tags/functions/load.json - Setup function
data/terralith/functions/setup.mcfunction
Terrain Generation
Noise routing, density functions, carvers, and surface inputs.
- Overworld noise settings
data/minecraft/worldgen/noise_settings/overworld.json - Vanilla final density router
data/minecraft/worldgen/density_function/overworld/noise_router/final_density.json - Terralith terrain density · Referenced registry IDs must remain stable.
data/terralith/worldgen/density_function/overworld/extra_terrain_sum.json - Configured carvers
data/terralith/worldgen/configured_carver/deep_ravine.json - Custom noise parameters
data/terralith/worldgen/noise/cave/thermal/magma.json
Biomes & Decoration
Biome generation settings resolve feature registries.
- Terralith biome catalog · Defines climate, effects, carvers, and generation settings.
data/terralith/worldgen/biome/skylands.json - Vanilla biome overrides
- Configured features · Defines what generates.
data/terralith/worldgen/configured_feature/skylands/island.json - Placed features · Adds placement modifiers to configured features.
data/terralith/worldgen/placed_feature/skylands/floating_islands.json - Block & biome tags · Classification boundary for features and mod ecosystems.
data/terralith/tags/blocks/volcano_blocks.json
Structures & Loot
Jigsaw structures resolve templates, processors, tags, and loot.
- Fortified village structure
data/terralith/worldgen/structure/fortified_village.json - Rare village placement
data/terralith/worldgen/structure_set/rare_village.json - Structure biome eligibility
data/terralith/tags/worldgen/biome/has_structure/fortified_village.json - Fortified village pool
data/terralith/worldgen/template_pool/village/fortified/starts.json - Village road processors
data/terralith/worldgen/processor_list/village/fortified/road.json - Village NBT templates
data/terralith/structures/village/fortified/start_castle.nbt - Fortified village loot
data/terralith/loot_tables/village/fortified/treasure.json
Version Overlays
Targeted registry replacements for supported Minecraft versions.
- Version overlays · Registry-compatible additions and replacements for 1.20.2, 1.20.3, and 1.20.5.
Connections 23
- Minecraft data-pack loader → Overworld definition: loads dimension
- Minecraft data-pack loader → Load function tag: runs load tag
- Load function tag → Setup function: registers function
- Version overlays → Overworld definition: replaces or extends IDs
- Version overlays → Overworld noise settings: replaces or extends IDs
- Overworld definition → Overworld noise settings: uses
- Overworld noise settings → Vanilla final density router: routes density sampling
- Vanilla final density router → Terralith terrain density: references terrain forms
- Terralith terrain density → Custom noise parameters: samples noise
- Overworld noise settings → Configured carvers: terrain generation includes
- Terralith biome catalog → Placed features: consumes
- Vanilla biome overrides → Placed features: consumes
- Placed features → Configured features: references
- Configured features → Block & biome tags: uses classifications
- Terralith biome catalog → Configured carvers: selects
- Terralith biome catalog → Custom noise parameters: uses surface patterns
- Rare village placement → Fortified village structure: places
- Fortified village structure → Structure biome eligibility: filters eligible biomes
- Fortified village structure → Fortified village pool: composes from
- Fortified village pool → Village road processors: applies
- Fortified village pool → Village NBT templates: selects templates
- Village NBT templates → Fortified village loot: containers resolve
- Terralith biome catalog → Rare village placement: provides generation context