Conditions
All 26 tests, plus and / or / not, for if, while and wait-until.
A condition is a value block, not an action. It never stands on its own: it plugs into the socket on an if, a while or a wait until, or into one of the and / or / not blocks at the bottom of this page.
Every test is the same block, test, with a dropdown choosing which one. The rest of its fields light up according to that choice:
| Field | Used by |
|---|---|
| the text box | the item, chat, block and variable tests |
| the match dropdown (registry name / display name / lore) | the item tests |
| the comparison (at least, more than, exactly, at most, fewer than) and the number | the counting and threshold tests |
| the variable row | the three variable tests |
| the coordinate row, with "relative to the client" | client-at-coords and block-at-coords |
Nesting is bounded: conditions may be 6 levels deep, and an and / or block takes at most 10 children.
Item and block conditions match a real item or block name exactly (diamond is not a
diamond_sword); a partial word such as sword or planks matches any name containing it.
has_item
True when the client is carrying the named item.
holding
True when the named item is in the client's hand.
inventory_full
True when no inventory slot is free.
health_below
True when health is under the number. 20 is full hearts.
health_above
True when health is over the number.
food_below
True when hunger is under the number. 20 is full.
food_above
True when hunger is over the number.
item_count
Compares how many of an item the client carries against a number. This is the test that uses the comparison dropdown.
free_slots_below
Compares the number of empty inventory slots against a number. Despite the name, the comparison dropdown applies, so it can also mean "more than".
container_has_item
True when the open container holds the named item. Needs a window open, so pair it with open container.
player_near
True when any player is within the number of blocks.
Unlike the player_near trigger, which fires once on entry, this simply asks whether someone is there right now.
player_near_named
True when the named player is within the number of blocks (0 means 16). The name
matches whatever its case.
mob_near
True when a hostile mob is within range.
chat_matches
True when the latest chat line matches the pattern. Only meaningful inside a chat-driven
firing. When the line has a sender (<Alice> !stop, [VIP] Alice: !stop), the pattern sees
only the message after the name, so ^!stop$ matches; a line with no sender is tested whole.
time_of_day
True when the real clock is between two times, in UTC.
Write whole hours (08-20) or hours and minutes (08:30-17:45). The start counts, the end
does not, and a range whose end is earlier than its start runs past midnight. Anything else
is refused when you save the flow.
For the in-game clock use mc_time_between.
mc_time_between
True when the in-game clock is between two times.
Write the times as game ticks (13000-23000, 0 to 24000, where 0 is sunrise and 6:00 in the
game), as hours (18-06) or as hours and minutes (19:30-05:00) of the in-game day. A range
whose end is earlier than its start runs past midnight. Anything else is refused when you save
the flow.
is_day
True during the in-game day.
is_raining
True while it is raining.
is_thundering
True during a thunderstorm. Worth separating from rain: a thunderstorm is what lets the client sleep during the day.
players_online
Compares the server's player count against a number.
at_coords
True when the client is within a radius of a position. The radius is the number field, and defaults to 2 blocks. Tick "relative to the client" to read the coordinates as an offset instead.
block_at
True when the block at a position is the named one. Takes the same coordinate row, with the same relative option.
last_action_failed
True when the step just before it reported a failure. The way to check instead of guessing:
a container action with no window open, or a wait that timed out with its fail box
ticked. Only the latest step counts: one that succeeds clears it, and so does a log,
wait or set_var in between. A repeat, while
or if passes on what its last step left, and a
try counts as one step.
var_equals
True when a flow variable equals the text, compared as text.
var_number
Reads a variable as a number and compares it, using the comparison dropdown.
var_matches
True when a variable matches a regular expression.
all
True only when every child condition is true. This is AND. Takes up to 10 children.
any
True when at least one child condition is true. This is OR. Takes up to 10 children.
not
Inverts a condition.
Only the first child counts. A not given several children ignores all but the
first. Wrap them in an all or any if you meant to negate the group.