NBT Requirement
Cold Sweat uses a custom NBT checker to evaluate a target item, entity, or block. The general syntax remains the same, but Cold Sweat's NBT system also supports defining multiple accepted values for a given NBT tag. This is done by using custom structures.
cs:any_of
cs:any_of
Checks the target NBT against a list of provided values, passing if any of the values match. This is done by specifying a compound tag, with the only key being "cs:any_of
" and its value being the list of options.
Example:
This translates to:
If HeatLevel matches either of the given values, the check will pass. This is a very useful alternative to defining multiple possible NBT structures for the same thing.
Numerical Ranges
It is also possible to define a range of accepted values if the tag being checked is a number.
Example:
Checks if an item's damage is somewhere between 50 and 100. Note that ranges are represented by a string value of two numbers separated by a hyphen ( - ). Decimal values are also accepted.
List Contents
When checking the contents of a list, the Vanilla NBT system would require that the contents of the list match the test exactly. This isn't always desired, so Cold Sweat introduces two new arguments, which are formatted in a similar way to cs:any_of
:
cs:contains_any
cs:contains_any
Checks if the list contains any, but not necessarily all, of the provided values.
Example:
cs:contains_all
cs:contains_all
Checks if the list contains all of the given values, and fails if one or more of the specified elements are not present. The list may contain additional entries not included in the check.
Example:
Last updated