Respackopts/docs/ToggleFiles.md

38 lines
1.2 KiB
Markdown

# Toggle Files
This is a simple `IF` statement simply returning true/false to if the texture/file should be loaded into the pack.
(Turns the texture "on" or "off").
You will need the `Pack ID` and `Entry Name` from your `/assets/respackopts/conf.json` that you created earlier
if you have not, see [Main Config](./MainConfig.md) on how to do so.
<br>
You will need to navigate to the file you would like to toggle inside your resource, and create a `.rpo` file for it in the same folder(directory).
<br>
### Examples:
`texture.png` would be `texture.png.rpo`<br>
`recipe.json` would be `recipe.json.rpo`
<br>
### Layout:
```json
{
"condition": "<pack id>:<entry name>"
}
```
### Example:
```json
{
"condition": "examplePack:someTexture"
}
```
### Built-in conditions
Respackopts provides some conditions by default, you can use them in any pack.
| Condition | Explaination |
| --- | --- |
| `modversion:<mod>:<predicate>` | 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:*` |
See [Switch between two files](./ToggleFilesWithFallback.md) to see how to swap textures out with each other (alternate Options)