Skip to content

Commit 70a47cd

Browse files
committed
docs(worldgen): Rewrite worldgen doc from scratch.
1 parent f05f396 commit 70a47cd

File tree

7 files changed

+1443
-480
lines changed

7 files changed

+1443
-480
lines changed

website/src/jsMain/resources/markdown/doc/data-driven/Worldgen.md

Lines changed: 90 additions & 480 deletions
Large diffs are not rendered by default.
Lines changed: 257 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,257 @@
1+
---
2+
root: .components.layouts.MarkdownLayout
3+
title: Biomes
4+
nav-title: Biomes
5+
description: Define biomes with climate, effects, spawns, carvers, and features using Kore's DSL.
6+
keywords: minecraft, datapack, kore, worldgen, biome, carver, spawner, effects
7+
date-created: 2026-02-03
8+
date-modified: 2026-02-03
9+
routeOverride: /docs/data-driven/worldgen/biomes
10+
---
11+
12+
# Biomes
13+
14+
Biomes define climate, visuals, mob spawns, carvers, and the placed features list for each decoration step. In Minecraft, biomes control not
15+
just the terrain appearance but also weather behavior, mob spawning rules, and which features generate.
16+
17+
## How Biomes Work
18+
19+
In the Overworld, biome placement is determined by 6 climate parameters:
20+
21+
- **Temperature** - Controls snow/ice coverage and vegetation types (5 levels from frozen to hot)
22+
- **Humidity** - Affects vegetation density (5 levels from arid to humid)
23+
- **Continentalness** - Determines ocean/beach/inland placement
24+
- **Erosion** - Controls flat vs mountainous terrain (7 levels)
25+
- **Weirdness** - Triggers biome variants (e.g., Jungle → Bamboo Jungle)
26+
- **Depth** - Determines surface vs cave biomes
27+
28+
These parameters form a 6D space where each biome occupies defined intervals. The game selects the closest matching biome for any given
29+
location.
30+
31+
References: [Biome](https://minecraft.wiki/w/Biome), [Biome definition](https://minecraft.wiki/w/Biome_definition)
32+
33+
## Basic Biome
34+
35+
```kotlin
36+
val myBiome = dp.biome("my_biome") {
37+
temperature = 0.8f
38+
downfall = 0.4f
39+
hasPrecipitation = true
40+
41+
effects {
42+
skyColor = 0x78A7FF
43+
fogColor = 0xC0D8FF
44+
waterColor = 0x3F76E4
45+
waterFogColor = 0x050533
46+
}
47+
}
48+
```
49+
50+
## Effects
51+
52+
The `effects` block controls visual and audio aspects of the biome. These settings define the atmosphere players experience, from sky color
53+
to ambient sounds.
54+
55+
Reference: [Biome definition - Effects](https://minecraft.wiki/w/Biome_definition#Effects)
56+
57+
```kotlin
58+
effects {
59+
// Required colors
60+
skyColor = 0x78A7FF
61+
fogColor = 0xC0D8FF
62+
waterColor = 0x3F76E4
63+
waterFogColor = 0x050533
64+
65+
// Optional colors
66+
foliageColor = 0x59AE30
67+
grassColor = 0x79C05A
68+
69+
// Optional ambient effects
70+
// ambientSound = ...
71+
// moodSound { ... }
72+
// additionsSound { ... }
73+
// music { ... }
74+
// particle { ... }
75+
}
76+
```
77+
78+
## Spawners
79+
80+
Define mob spawn rules per category. Each spawner entry specifies the entity type, spawn weight (relative probability), and count range.
81+
Higher weights mean more frequent spawns relative to other entries in the same category.
82+
83+
Reference: [Biome definition - Mob spawning](https://minecraft.wiki/w/Biome_definition#Mob_spawning)
84+
85+
```kotlin
86+
spawners {
87+
creature {
88+
spawner(EntityTypes.COW, weight = 6, minCount = 2, maxCount = 4)
89+
spawner(EntityTypes.SHEEP, weight = 8, minCount = 2, maxCount = 4)
90+
}
91+
monster {
92+
spawner(EntityTypes.SKELETON, weight = 80, minCount = 1, maxCount = 2)
93+
spawner(EntityTypes.ZOMBIE, weight = 80, minCount = 1, maxCount = 2)
94+
}
95+
// Other categories: ambient, waterCreature, undergroundWaterCreature, waterAmbient, misc, axolotls
96+
}
97+
```
98+
99+
## Spawn Costs
100+
101+
Spawn costs control mob density using an energy budget system. Each mob type has an `energyBudget` (max population density) and `charge` (
102+
cost per mob). This prevents overcrowding while allowing natural mob distribution.
103+
104+
Reference: [Biome definition - Spawn costs](https://minecraft.wiki/w/Biome_definition#Spawn_costs)
105+
106+
```kotlin
107+
spawnCosts {
108+
this[EntityTypes.COW] = spawnCost(energyBudget = 1.2f, charge = 0.1f)
109+
this[EntityTypes.SHEEP] = spawnCost(energyBudget = 1.0f, charge = 0.08f)
110+
}
111+
```
112+
113+
## Carvers
114+
115+
Carvers hollow out terrain to create caves and canyons. They run during the `carvers` generation step, after terrain noise but before
116+
features. Two carving modes exist: `air` for standard caves and `liquid` for underwater caves.
117+
118+
Reference: [Carver](https://minecraft.wiki/w/Carver)
119+
120+
```kotlin
121+
carvers {
122+
air(myCaveCarver) // Carves air (caves)
123+
liquid(myUnderwaterCave) // Carves underwater caves
124+
}
125+
```
126+
127+
See [Carvers](#carvers-cavescanyons) below for creating configured carvers.
128+
129+
## Features
130+
131+
Features are attached to biomes via decoration steps. Each step runs in order during chunk generation, with structures placing before
132+
features within the same step. See the [main worldgen page](../worldgen#decoration-steps) for the full step list.
133+
134+
Reference: [Biome definition - Features](https://minecraft.wiki/w/Biome_definition#Features)
135+
136+
```kotlin
137+
features {
138+
fluidSprings = listOf(...)
139+
lakes = listOf(...)
140+
localModifications = listOf(...)
141+
rawGeneration = listOf(...)
142+
strongholds = listOf(...)
143+
surfaceStructures = listOf(...)
144+
topLayerModification = listOf(...)
145+
undergroundDecoration = listOf(...)
146+
undergroundOres = listOf(orePlaced)
147+
undergroundStructures = listOf(...)
148+
vegetalDecoration = listOf(treePlaced, flowerPlaced)
149+
}
150+
```
151+
152+
See [Features](./features) for creating configured and placed features.
153+
154+
---
155+
156+
# Carvers (Caves/Canyons)
157+
158+
Configured carvers remove terrain to form cave systems and canyons. They use noise-based algorithms to create natural-looking underground
159+
spaces. Carvers run after terrain generation but before features, ensuring caves don't destroy placed decorations.
160+
161+
Minecraft has two carver types:
162+
163+
- **Cave carvers** - Create winding tunnel systems with variable radius
164+
- **Canyon carvers** - Create deep ravines with steep walls
165+
166+
References: [Carver](https://minecraft.wiki/w/Carver), [Configured carver](https://minecraft.wiki/w/Configured_carver)
167+
168+
## Cave Carver
169+
170+
```kotlin
171+
val caveCfg = caveConfig {
172+
floorLevel = constant(-0.2f)
173+
horizontalRadiusMultiplier = constant(1.0f)
174+
lavaLevel = absolute(8)
175+
probability = 0.08
176+
verticalRadiusMultiplier = constant(0.7f)
177+
y = uniformHeightProvider(32, 128)
178+
yScale = constant(0.5f)
179+
}
180+
181+
val cave = dp.configuredCarver("my_cave", caveCfg) {}
182+
```
183+
184+
## Canyon Carver
185+
186+
```kotlin
187+
val canyonCfg = canyonConfig {
188+
lavaLevel = absolute(8)
189+
probability = 0.02
190+
y = uniformHeightProvider(10, 67)
191+
yScale = constant(3.0f)
192+
// Additional canyon-specific settings...
193+
}
194+
195+
val canyon = dp.configuredCarver("my_canyon", canyonCfg) {}
196+
```
197+
198+
---
199+
200+
# Complete Biome Example
201+
202+
```kotlin
203+
fun DataPack.createHighlandsBiome() {
204+
// Create a cave carver
205+
val caveCfg = caveConfig {
206+
floorLevel = constant(-0.2f)
207+
horizontalRadiusMultiplier = constant(1.0f)
208+
lavaLevel = absolute(8)
209+
probability = 0.08
210+
verticalRadiusMultiplier = constant(0.7f)
211+
y = uniformHeightProvider(32, 128)
212+
yScale = constant(0.5f)
213+
}
214+
val cave = configuredCarver("highlands_cave", caveCfg) {}
215+
216+
// Create placed features (see Features page)
217+
val treePlaced = /* ... */
218+
val orePlaced = /* ... */
219+
220+
// Create the biome
221+
biome("highlands") {
222+
temperature = 0.8f
223+
downfall = 0.3f
224+
hasPrecipitation = true
225+
226+
effects {
227+
fogColor = 0xBFEFFF
228+
skyColor = 0x99D9FF
229+
waterColor = 0x34A7F0
230+
waterFogColor = 0x0A2C4F
231+
}
232+
233+
spawners {
234+
creature {
235+
spawner(EntityTypes.COW, 6, 2, 4)
236+
spawner(EntityTypes.SHEEP, 8, 2, 4)
237+
}
238+
monster {
239+
spawner(EntityTypes.SKELETON, 80, 1, 2)
240+
spawner(EntityTypes.ZOMBIE, 80, 1, 2)
241+
}
242+
}
243+
244+
spawnCosts {
245+
this[EntityTypes.COW] = spawnCost(1.2f, 0.1f)
246+
this[EntityTypes.SHEEP] = spawnCost(1.0f, 0.08f)
247+
}
248+
249+
carvers { air(cave) }
250+
251+
features {
252+
undergroundOres = listOf(orePlaced)
253+
vegetalDecoration = listOf(treePlaced)
254+
}
255+
}
256+
}
257+
```

0 commit comments

Comments
 (0)