BuildcordDocs

Comparison

Branch on how two values compare.

logic.condition compares two values and takes one of two ways out.

Settings

SettingWhat it does
ValueThe left side, such as {option.amount}.
IsThe test. See the table below.
Compared toThe right side, such as 10. Ignored for the tests with nothing on their right.
TestPasses when
equals, doesn't equalThe two are the same, or not. Numbers compare as numbers, so 5 equals 5.0.
is greater than, is at least, is less than, is at mostBoth are numbers, and they compare that way.
contains, doesn't contain, starts with, ends withThe text does, ignoring capitals.
is empty, isn't emptyThe value has nothing in it but spaces, or has something.
is a numberThe value reads as a number.
matches the patternThe value matches a regular expression, such as ^\d{4}$.
is one of, isn't one ofThe value is among a list, separated by commas or by lines, such as red, green, blue or {var.allowed}.

Ways out

Way outTaken when
TrueThe test passes.
FalseIt doesn't.

Notes

  • Both sides accept tokens.
  • The canvas shows the test as a sign, such as {option.amount} ≥ 10.
  • To test more than one thing at once, use Several conditions. To go a different way for each of many values, use Switch.

Example

{option.amount} is at least 1 stops a command from taking a zero or negative amount.

On this page