Introduction
The Modifier System is the core of Lithostitched’s functionality, providing a powerful data-driven approach to modifying Minecraft’s worldgen without code. Modifiers are JSON files placed indata/<namespace>/lithostitched_worldgen_modifier/ that apply changes to existing worldgen elements.
How Modifiers Work
Modifiers are applied during server startup after all worldgen data is loaded. They allow you to:- Add or remove structures from structure sets
- Inject elements into template pools
- Modify surface rules and density functions
- Add or remove biome features and spawns (Fabric)
- Configure structure processors and more
Modifier interface:
Priority System
Modifiers execute in order based on theirpriority field. Lower numbers run first:
Determines execution order. Lower values execute first.Default priorities:
- Default modifiers:
1000 - Remove modifiers:
2000(execute after additions) - NoOp modifier:
0(highest priority)
Modifier Categories
Lithostitched provides several categories of modifiers:Structure Modifiers
Modify template pools, structure sets, and structure configurations
Surface Modifiers
Add and modify surface rules for terrain generation
Density Modifiers
Wrap and modify density functions and noise routers
Common Modifier Types
No-Op Modifier
Theno_op modifier does nothing and is useful for overriding modifiers from other datapacks:
data/<namespace>/lithostitched_worldgen_modifier/<path>.json to override another modifier at the same path.
Stack Feature Modifier
Thestack_feature modifier wraps existing configured features with additional placed features, allowing layered generation:
The configured features to wrap with additional generation
The placed feature to add on top of base features
How to handle placement failures:
CANCEL_ON_FAILURE, CONTINUE_ON_FAILURE, or REQUIRE_ALLSee the Adding Modifiers guide for practical examples.
File Location
All modifiers must be placed in:Modifiers with the same file path override each other based on datapack priority. Higher priority datapacks override lower ones.
Execution Flow
TheModifierManager handles modifier application:
- Server starts and loads all worldgen data
- Lithostitched collects all modifiers from datapacks
- Modifiers are sorted by priority (lowest first)
- Each modifier applies its changes sequentially
- Worldgen is ready with all modifications applied
Best Practices
Use appropriate priorities
Use appropriate priorities
- Use default priority (1000) for most additions
- Use higher priority (2000+) for removals to ensure they run after additions
- Use lower priority (500-999) for base modifications that should run first
Organize modifiers logically
Organize modifiers logically
- Group related modifiers in subdirectories
- Use descriptive file names
- Consider using prefixes like
01_,02_for clear ordering
Test modifier combinations
Test modifier combinations
- Multiple modifiers can target the same registry entry
- Ensure modifiers work together correctly
- Use debug logging to verify execution order
Document your modifiers
Document your modifiers
- Add comments in adjacent
.txtfiles if needed - Use clear, descriptive naming
- Keep modifier files focused on single concerns
Registry Keys
Modifiers are registered under:Next Steps
Structure Modifiers
Learn about template pool and structure set modifiers
Surface Modifiers
Discover surface rule modification
Density Modifiers
Explore density function wrapping
Common Patterns
See practical modifier examples
