Overview
Lithostitched’s worldgen customization is entirely data-driven through JSON files in Minecraft data packs. This allows you to modify world generation without writing any Java code, making it accessible to modpack developers and server administrators.All worldgen modifiers are loaded from the
data/<namespace>/lithostitched/worldgen_modifier/ directory in data packs.File Structure
Worldgen modifier files follow Minecraft’s standard data pack structure:- Resource Location
- Namespace
Each file creates a modifier with the resource location:For example:
data/mypack/lithostitched/worldgen_modifier/add_villages.json- Becomes:
mypack:add_villages
Basic JSON Structure
Every modifier JSON file must have atype field that specifies which modifier type to use:
Required Fields
The modifier type identifier (e.g.,
lithostitched:add_surface_rule)Optional Fields
Execution order priority. Lower values execute first. Common values:
- 500-900: Foundational changes
- 1000: Default modifications
- 2000: Removals and overrides
Example Modifiers
Internal System Modifier
This minimal modifier is used internally by Lithostitched:/home/daytona/workspace/source/src/common/main/resources/data/lithostitched/lithostitched/worldgen_modifier/compile_raw_templates.json
Internal modifiers (prefixed with
internal/) are used by Lithostitched itself and typically don’t require additional configuration.Pool Aliases Modifier
This example sets up pool aliases for Trial Chambers structure spawners:/home/daytona/workspace/source/src/common/main/resources/data/lithostitched/lithostitched/worldgen_modifier/set_trial_chambers_pool_aliases.json
Understanding this example
Understanding this example
Common Modifier Types
Add Surface Rule
Adds custom surface rules to dimension generation:Add Desert Glass Surface
Remove Structure Set Entries
Removes structures from structure sets:Remove Villages from Plains
Add Template Pool Elements
Adds new structure pieces to jigsaw template pools:Add Custom Village House
Wrap Density Function
Modifies dimension density functions:Flatten Terrain
Data Pack Integration
Create pack.mcmeta
Install Data Pack
Place your data pack in:
<world>/datapacks/for single-player worlds- Server’s
datapacks/folder for multiplayer servers
Debugging and Validation
Enable Debug Logging
Modify the Lithostitched config file to enable debug messages:config/lithostitched.json
With debug logging enabled, you’ll see messages like:
Common JSON Errors
Invalid codec error
Invalid codec error
Cause: JSON structure doesn’t match the codec definitionSolution: Check that all required fields are present and have correct types
Unknown modifier type
Unknown modifier type
Cause: The
type field references a non-existent modifier typeSolution: Verify the modifier type is registered and spelled correctlyRegistry not found
Registry not found
Cause: Referencing a resource that doesn’t exist (e.g., wrong structure ID)Solution: Check that all referenced resources exist and use correct namespaces
Modifiers not applying
Modifiers not applying
Cause: Priority conflicts or modifier order issuesSolution: Adjust priority values and check debug logs for application order
Resource References
Using Tags
Many fields support tag references using the# prefix:
Using Direct References
Or reference specific resources directly:Holder Sets
Some fields accept either a single value or a list:Advanced Patterns
Conditional Modifiers
Combine modifiers with conditions to create complex behaviors:Conditional Surface Rule
Modifier Chains
Use priorities to create sequences of related modifiers:Modifier Chain
Best Practices
Use Descriptive Names
Name your modifier files descriptively:
- ✅
add_desert_temples.json - ❌
modifier1.json
Organize by Category
Group related modifiers in subfolders:
Comment with Descriptions
While JSON doesn’t support comments, use descriptive type names and consider maintaining a separate README
Test Incrementally
Test each modifier individually before combining them to isolate issues
Always test worldgen changes in a new world. Existing chunks won’t be affected by data pack changes.
Related Resources
Modifiers
Learn about modifier interface and priority system
Registry System
Understand how types are registered
