Overview
Density modifiers allow you to modify Minecraft’s terrain generation at a fundamental level by wrapping density functions and noise routers. Density functions determine the 3D shape of terrain, caves, and other world features.Wrap Density Function
Wraps an existing density function with a custom density function, allowing modification of terrain shape.How It Works
The modifier replaces the target density function’s value with aMergedDensityFunction that applies the wrapper function. The wrapper can reference the original function using marker density functions:
lithostitched:wrapped_marker- References the current/wrapped valuelithostitched:original_marker- References the original unwrapped value
Parameters
Must be
"lithostitched:wrap_density_function"Execution priority. Lower values execute first, affecting wrapper nesting order.
Registry ID of the density function to wrap. Must be a reference to a registered density function.
The density function to wrap around the target. Can be:
- A registry ID (string) referencing another density function
- An inline density function definition (object)
lithostitched:wrapped_marker- The wrapped/modified valuelithostitched:original_marker- The original value before any wrapping
Examples
Wrap Noise Router
Wraps specific targets in a dimension’s noise router, modifying how density functions are used for terrain generation.How It Works
Noise routers contain multiple density functions for different purposes (continents, erosion, depth, etc.). This modifier wraps one of those targets with a custom density function, allowing targeted terrain modifications.Parameters
Must be
"lithostitched:wrap_noise_router"Execution priority. Multiple modifiers with the same target are applied in priority order.
Registry ID of the dimension to modify.Common values:
"minecraft:overworld""minecraft:the_nether""minecraft:the_end"
Which noise router target to wrap.Available targets:
barrier- Barrier noise for aquifer barriersfluid_level_floodedness- Aquifer flood levelfluid_level_spread- Aquifer spreadlava- Lava level noisetemperature- Temperature noisevegetation- Vegetation noisecontinents- Continental shapeerosion- Erosion shapingdepth- Terrain depthridges- Ridge formationsinitial_density- Initial 3D terrain densityfinal_density- Final terrain density (after caves)vein_toggle- Ore vein togglevein_ridged- Ore vein ridgesvein_gap- Ore vein gaps
The density function to wrap around the target. Use
lithostitched:wrapped_marker to reference the original target value.Examples
Marker Density Functions
Lithostitched provides special marker density functions for referencing wrapped values:Wrapped Marker
References the current wrapped/modified value of the density function.Original Marker
References the original unwrapped value before any modifications.Noise Router Targets
Detailed explanation of each noise router target:continents
continents
Controls large-scale continental landmass shapes. Higher values create more land, lower values create more ocean.Use cases: Adjust ocean/land ratio, create more dramatic coastlines
erosion
erosion
Controls terrain erosion patterns affecting valleys, mountains, and plains.Use cases: Make terrain more rugged or smoother, adjust valley depth
depth
depth
Affects the depth/height offset of terrain.Use cases: Raise or lower overall terrain height, create floating islands
ridges
ridges
Controls ridge and peak formations in mountainous terrain.Use cases: Make mountains more jagged or rounded, adjust peak height
initial_density
initial_density
The initial 3D density before caves and features are carved.Use cases: Fundamental terrain shape modification, terrain amplification
final_density
final_density
The final density after caves and features, determines solid vs air blocks.Use cases: Add noise to terrain surfaces, create unusual formations
temperature
temperature
Controls temperature distribution affecting biome placement.Use cases: Shift climate zones, create temperature gradients
vegetation
vegetation
Affects vegetation/humidity distribution for biome placement.Use cases: Modify biome distribution patterns, create vegetation bands
vein_toggle, vein_ridged, vein_gap
vein_toggle, vein_ridged, vein_gap
Control ore vein generation introduced in 1.18.Use cases: Modify ore vein frequency, size, or distribution
Density Function Wrapper System
The wrapping mechanism uses theDensityFunctionWrapper utility:
Best Practices
Understand density function math
Understand density function math
Density functions use mathematical operations:
minecraft:add- Additionminecraft:mul- Multiplicationminecraft:clamp- Limit to min/max rangeminecraft:blend_density- Smooth blending
Use clamp to prevent extreme values
Use clamp to prevent extreme values
Always clamp modified density functions to reasonable ranges to prevent terrain artifacts:
Test extensively
Test extensively
- Generate multiple worlds with different seeds
- Check terrain at different coordinates (0,0 vs 10000,10000)
- Verify biome transitions look natural
- Test in multiplayer to catch synchronization issues
Monitor performance
Monitor performance
Density functions run for every block during generation. Complex wrappers can slow world generation:
- Use simple operations when possible
- Avoid deeply nested functions
- Profile with spark or similar tools
Layer modifications carefully
Layer modifications carefully
When multiple modifiers target the same function:
- Use priority to control order
- Consider whether each needs original vs wrapped value
- Test with all modifiers active simultaneously
Common Patterns
Terrain Amplification
Multiply density functions by constants > 1.0 to create more dramatic terrain
Terrain Smoothing
Multiply by constants < 1.0 or use quarter_negative to smooth terrain
Height Offset
Add constants to depth or density to raise/lower terrain
Noise Injection
Add noise functions to create variation in otherwise uniform terrain
Advanced Example: Multi-Layer Modification
Related
Density Functions
Learn about density function types
Noise Settings
Understand noise configuration
Surface Modifiers
Modify surface block placement
Examples
See practical density modifier examples
