Respackopts/docs/AdvancedConditions.md

1.7 KiB

Advanced Conditions

Respackopts uses "conditions" for deciding what files to load. Respackopts conditions are usually a simple string with the entry name (for example, someTexture), however, respackopts provides various additional features to enhance their functionality. This functionality is powered by the μScript language This page will provide a quick overview over the available operations. For more complete documentation, use the above link.

(Boolean) logic

You can use logic operations on several values to only show resources when a combination of them applies Some common logical operations are supported, others indirectly. That includes NOT (!), AND (&), OR (|), XOR (==) and XNOR (!=)

Numbers

Numeric values can be accessed by their name, just like boolean values. All typical mathematical operations are supported, that includes addition (+), subtraction (-), multiplication (*), division (/) and modulo (%)

Accessing values

By default, all values for the current pack will be available by their name or as entries of a category (someCategory.someOption). In addition, all values of other packs are accessible under their pack id (somePack.someOption). Respackopts also allows checking mod (or minecraft) versions against predicates as follows: version('<mod name>', '<predicate>'), for example version('minecraft', '<=1.16.5')

Fabric Resource Conditions Interop

Fabric API provides a system called resource conditions, which is similar to respackopts own system. Respackopts previously allowed accessing fabric resource conditions and respackopts conditions from one another, however, this feature was removed in favor of enforcing the new muscript syntax.