Overview
The cave carving system is defined incarving_substratum.yml and uses a 3D expression-based sampler that combines:
- Spaghetti Caves: Long, winding tunnels created with simplex noise
- Cheese Caves: Large caverns with irregular shapes
- Mega Caves: Massive underground chambers
- Pillars: Structural support columns within large caves
The carving system operates on a carving threshold model: when the combined noise value exceeds the threshold, terrain is carved out to create cave space.
Carving Configuration
Here’s the core carving configuration fromcarving_substratum.yml:
Cave Generation Types
Spaghetti Caves
Spaghetti caves create long, winding tunnels that snake through the underground. The system uses two layers of simplex noise to create variation:spaghettiStrengthLarge: Controls the intensity of large tunnel carving (default: 0.59)spaghettiStrengthSmall: Controls the intensity of small tunnel carving (default: 0.57)
Technical Details
Technical Details
Spaghetti caves use the absolute value of two offset simplex noise functions, averaged together. This creates tubular structures by carving where the combined noise is low. The Y-offset (1000, 2000, 3000) ensures each layer samples different regions of the noise field.
Cheese Caves
Cheese caves create large, irregular caverns with a “swiss cheese” appearance. They use domain-warped 3D simplex noise:cheeseStrength: Overall intensity of cheese cave carving (default: 0.8)cheeseHorizontalFrequency: Horizontal stretch of caverns (default: 1.5)cheeseVerticalFrequency: Vertical stretch of caverns (default: 3)cheeseMaxHeight: Maximum Y-level for cheese caves (default: 90)cheeseMaxTaper: Vertical taper distance at max height (default: 40)
Cheese caves are only generated below Y=90 to prevent them from breaking through to the surface.
Mega Caves
Mega caves create massive underground chambers using very low-frequency noise:megaCaveStrength: Intensity of mega cave carving (default: 0.3)megaCaveSize: Threshold for mega cave formation (default: 0.3)frequency: 0.003 (very low frequency creates large features)
Understanding Frequency
Understanding Frequency
The frequency of 0.003 means the noise pattern repeats roughly every 333 blocks (1/0.003). This creates massive chambers that can span hundreds of blocks.
Cave Pillars
Pillars provide structural support in large caverns using cellular noise:pillarStrength: How strongly pillars prevent carving (default: 0.5)pillarRadius: Size of pillar protection radius (default: 0.02)frequency: 0.05 (creates pillar centers every ~20 blocks)
Pillars use 2D cellular noise (X and Z only), creating vertical columns that extend through cave layers.
Height Ranges and Tapering
The carving system uses sophisticated height-based tapering to smoothly transition caves at vertical boundaries:Height Parameters
Taper Function
ThemaskSmooth function creates smooth transitions:
- Below
heightMin: Carving is fully disabled - Between
heightMinandheightMax: Carving smoothly increases - Above
heightMax: Carving is at full strength
Example: Bottom Taper
Example: Bottom Taper
carvingMinHeight: -63 and carvingMinTaper: 8:- At Y=-63: 0% carving strength
- At Y=-55: 100% carving strength
- Between: Linear interpolation
Noise Samplers
The carving system uses several noise types:Simplex3 (3D Simplex)
Simplex2 (2D Simplex)
Tuning Cave Generation
You can adjust cave characteristics by modifying parameters:More Caves
Larger Caverns
Taller Caves
More Mega Caves
Be careful when adjusting
carvingThreshold - small changes can dramatically affect cave density. Values above 0.6 may result in very few caves, while values below 0.5 may create excessive carving.Complete Expression Structure
The carving expression combines all systems with proper height masking:- Starts with negative threshold
- Adds combined cave generation values
- Applies height checks and tapering
- Carves where the result is positive
See Also
- Custom Features - Learn how features populate carved caves
- Palette System - Understand how cave walls are textured
- Cave Biomes - Explore different cave biome types
