2021-09-15 15:17:32 +02:00
|
|
|
# Switch between two files
|
2021-08-30 15:03:33 +02:00
|
|
|
This is a simple `IF` statement simply returning true/false to if the texture/file should be loaded into the pack.
|
2021-08-30 14:38:03 +02:00
|
|
|
(Pick one file over another).
|
2022-08-28 20:43:13 +02:00
|
|
|
You will need the `Pack ID` and `Entry Name` from your `respackopts.json5` that you created earlier
|
2022-08-30 13:31:08 +02:00
|
|
|
if you have not, see [Main Config](../setup/MainConfig.md) on how to do so.
|
2021-08-30 14:38:03 +02:00
|
|
|
<br>
|
|
|
|
|
2021-08-30 15:03:33 +02:00
|
|
|
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 directory (folder).
|
2021-08-30 14:38:03 +02:00
|
|
|
<br>
|
|
|
|
|
|
|
|
### Examples:
|
|
|
|
`texture.png` would be `texture.png.rpo`<br>
|
|
|
|
`SomeRecipe.json` would be `SomeRecipe.json.rpo`
|
|
|
|
<br>
|
|
|
|
|
|
|
|
### Layout:
|
|
|
|
```json
|
|
|
|
{
|
2022-06-07 23:23:14 +02:00
|
|
|
condition: "<entry name>",
|
|
|
|
fallback: "location/of/the/file"
|
2021-08-30 14:38:03 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
### Example:
|
|
|
|
```json
|
|
|
|
{
|
2022-06-07 23:23:14 +02:00
|
|
|
condition: "someTexture",
|
|
|
|
fallback: "assets/minecraft/textures/example/alternate.png"
|
2021-08-30 14:38:03 +02:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2022-02-19 15:10:53 +01:00
|
|
|
## Another way to do this:
|
2022-02-17 21:37:57 +01:00
|
|
|
Respackopts supports specifying multiple possible fallbacks when configuring single files.
|
|
|
|
You can use this functionality as follows:
|
|
|
|
```json
|
|
|
|
{
|
2022-06-07 23:23:14 +02:00
|
|
|
condition: "<entry name>",
|
|
|
|
fallbacks: [
|
2022-02-17 21:37:57 +01:00
|
|
|
"location/of/the/file",
|
|
|
|
"assets/minecraft/textures/example/alternate.png"
|
|
|
|
]
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
|
|
|
```json
|
|
|
|
{
|
2022-06-07 23:23:14 +02:00
|
|
|
condition: "someTexture"
|
2022-02-17 21:37:57 +01:00
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2021-09-15 15:17:32 +02:00
|
|
|
See [Toggle Files ](./ToggleFiles.md) to see how to just disable files.
|