# Advanced Conditions Respackopts uses "conditions" for deciding what files to load. Respackopts conditions are usually a simple string with a pack and entry name (IE `:` or ``), however, respackopts provides various additional features to enhance their functionality. This page will go over everything you can do with conditions ## (Boolean) logic Any JSON object will be treated as a logical condition. This behavior allows defining resources that are only used when a set of conditions are met, not just one. Be aware that nesting logic operations is supported and recommended for advanced setups The following expressions are supported: | Example | Explaination | |-----------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------| | `{"not": "examplePack:condition1"}` | True if the contained condition is false | | `{"and": ["examplePack:condition1", "examplePack:condition2"]}` | True if all contained conditions are true | | `{"or": ["examplePack:condition1", "examplePack:condition2"]}` | True if any contained condition is true | | `{"nor": ["examplePack:condition1", "examplePack:condition2"]}` | True if none of the contained conditions are true | | `{"xor": ["examplePack:condition1", "examplePack:condition2"]}` | True if the number of contained conditions which are true is an odd number | | `{"eq": ["examplePack:condition1", "examplePack:condition2"]}` | True if all contained conditions have the same value
(equivalent to `{"or": [{"and": [...]}, {"nor": [...]}]}`) | ## Built-in conditions Respackopts provides some conditions by default, you can use them in any pack. | Condition | Explaination | |--------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------| | `modversion::` | True if the specified mod is loaded (use the mod ID) and the version fits the predicate.
Example: `modversion:minecraft:>=1.7.10`, `modversion:continuity:*` | ## Fabric Resource Conditions Interop Fabric API provides a system called resource conditions, which is similar to respackopts own system. To improve compatibility, respackopts allows accessing fabric resource conditions and respackopts conditions from one another. ### Fabric Resource Conditions from Respackopts A json object containing a singular entry whose key is `fabric:load_conditions` will be treated as a Fabric Resource Condition. Example: ```json { "condition": { "fabric:load_conditions": { "condition": "fabric:not", "value": { "condition": "fabric:all_mods_loaded", "values": [ "a" ] } } } } ``` ### Respackopts conditions from Fabric You may access respackopts conditions from Fabric API Resource Condition blocks by specifying a condition with the ID `config`. Its value will be treated as a respackopts condition. Please be aware that fabric resource conditions are not tied to resource packs and entry IDs must therefore be specified fully. (Using `someTexture` instead of `examplePack:someTexture` is impossible) Example: ```json { "type": "minecraft:crafting_shapeless", "ingredients": [ { "item": "minecraft:stick" } ], "result": { "item": "minecraft:diamond" }, "fabric:conditions": [ { "condition": "fabric:not", "value": { "condition": "respackopts:config", "value": { "and": [ "examplePack:someTexture" ] } } } ] } ```