Adding Conditional Resources That Only Load When a Mod Is Present
Why Conditions Matter
ARRP's headline feature is conditional resources: you can emit a recipe, model, or loot table only when a certain condition is true — for example, another mod being loaded, or a config flag being set. This keeps your generated pack from referencing content that does not exist.
Writing a Condition
1. In your resource generator, before writing a resource, evaluate a condition using ARRP's condition helpers. The common one checks whether a mod id is loaded; others can check tags or config values.
2. Wrap the resource output in that condition so ARRP only writes the JSON when the check passes.
3. For resources that depend on another mod's items or blocks, always gate them behind a "mod loaded" condition — otherwise the generated recipe or model will point at a missing registry entry and cause errors.
4. If you need several resources to share the same condition, group them under one condition block rather than repeating the check.
Verifying Behavior
Reload resources once with the dependency present and once without (or toggle the config). With the condition false, the resource should simply be absent from the pack — no error, no broken model. With it true, the resource appears normally. This conditional generation is what lets a single ARRP-based mod adapt to whatever else is installed.