A data-driven mod for Hytale that adds coal ore to world generation using only JSON files - no Java code required!
CoalMod demonstrates the data-driven approach to adding ores using WorldGenOverlayLib. This mod contains:
- Zero Java code - completely JSON-based
- Overlay configuration file
- Ore definition files (
Coal.jsonandCoalPlacement.jsonfor each zone)
CoalMod uses WorldGenOverlayLib's auto-discovery feature:
- The overlay configuration is defined in
Server/WorldGenOverlays/overlays.json - WorldGenOverlayLib's
AutoOverlayPluginautomatically discovers and registers the overlay - All coal ore files are placed in the
Ores/ZoneX/structure - Placement references are automatically merged into
Caves.jsonfiles for all relevant zones
CoalMod/
└── Server/
├── WorldGenOverlays/
│ └── overlays.json (overlay configuration)
└── World/
└── Default/
└── Ores/
├── Zone0/
│ ├── Coal.json
│ └── CoalPlacement.json
├── Zone1/
│ ├── Coal.json
│ └── CoalPlacement.json
├── Zone2/
│ ├── Coal.json
│ └── CoalPlacement.json
├── Zone3/
│ ├── Coal.json
│ └── CoalPlacement.json
└── Zone4/
├── Coal.json
└── CoalPlacement.json
The overlay is configured in Server/WorldGenOverlays/overlays.json:
{
"Overlays": [
{
"Name": "Coal Ore Overlay",
"Generator": "Default",
"Ores": ["Coal"],
"Zones": [
"Zone0",
"Zone1",
"Zone2",
"Zone3",
"Zone4"
]
}
]
}Configuration Fields:
Name(optional): Display name for the overlayGenerator(required): World generator name (usually"Default")Ores(required): Array of ore names (e.g.,["Coal"]) - all ores share the same zonesZones(required): Array of ore zone numbers ("Zone0"through"Zone4") - applies to all ores
- WorldGenOverlayLib: Required for overlay discovery and merging
- Hytale:WorldGen: Required for world generation
Since this is a data-driven mod with no Java code, building is simple:
./gradlew buildThe build will:
- Process resources (including manifest.json)
- Package everything into a JAR
- No Java compilation needed!
-
Build WorldGenOverlayLib first:
cd ../WorldGenOverlayLib ./gradlew build publishToMavenLocal -
Build CoalMod:
cd ../CoalMod ./gradlew build -
Install both mods to your Hytale server:
- Copy
WorldGenOverlayLib/build/libs/WorldGenOverlayLib-1.0.0.jarto your server'smods/folder - Copy
CoalMod/build/libs/CoalMod-1.0.0.jarto your server'smods/folder
- Copy
- No Java Knowledge Required: Just edit JSON files
- Easy to Modify: Change zones by editing the config
- Easy to Share: Distribute as a resource pack - no compilation needed
- Version Control Friendly: JSON files are easy to diff and merge
- Quick Iteration: Change config and rebuild - no code compilation
To customize CoalMod:
- Add/Remove Zones: Edit
overlays.jsonand modify theZonesarray - Modify Ore Generation: Edit the
Coal.jsonfiles in each zone folder - Adjust Ore Placement: Edit the
CoalPlacement.jsonfiles to change density, height ranges, block masks, etc.
Simply add the zone number to the Zones array in overlays.json:
"Zones": [
"Zone0",
"Zone1",
"Zone2",
"Zone3",
"Zone4",
"Zone5" // Add this (if Zone5 exists in Hytale)
]Make sure you have the corresponding Coal.json and CoalPlacement.json files in:
Server/World/Default/Ores/Zone5/
See LICENSE file for details.