Skip to content

Load Conditions

Apollo edited this page Sep 16, 2024 · 2 revisions

Load conditions aren't a part of Lithostitched directly, but they're built into both Fabric and Neoforge and are useful for compatibility reasons.

Let's say you wanted to add a rock feature to Terralith's Forested Highlands biome. Your worldgen modifier may look like this:

{
  "type": "lithostitched:add_features",
  "biomes": "terralith:forested_highlands",
  "features": "my_mod:rock",
  "step": "vegetal_decoration"
}

The game will throw an error when loading the pack if Terralith isn't installed because it can't find the terralith:forested_highlands biome. Using load conditions, we can tell the game to simply not load the modifier file if Terralith isn't installed.

Neoforge has a documentation page on their format, and Fabric has javadocs on their format. If you're building a datapack/mod for both Fabric and Forge, the modifier above can be modified to this to fix it:

{
  "fabric:load_conditions": {
    "condition": "fabric:all_mods_loaded",
    "values": [
      "terralith"
    ]  
  },
  "neoforge:conditions": [
    {
      "type": "neoforge:mod_loaded",
      "modid": "terralith"
    }
  ],
  "type": "lithostitched:add_features",
  "biomes": "terralith:forested_highlands",
  "features": "my_mod:rock",
  "step": "vegetal_decoration"
}