Conditions

Boolean expressions used inside if/else if blocks. Can be combined with 'and' or 'or' keywords.

114 patterns

Attribute

%e:ENTITY_POSSESSIVE% %attr:ATTRIBUTE% [value] %op:OP% %val:EXPR%
Attribute
1.0.0

Compares a living entity's attribute value against a number using a relational operator.

Examples
if mob's max_health > 20:
%e:ENTITY% has %attr:ATTRIBUTE%
Attribute
1.0.0

Checks if a living entity has the specified attribute.

Examples
if mob has max_health:
%e:ENTITY% (does not have|doesn't have|lacks) %attr:ATTRIBUTE%
Attribute
1.0.0

Checks if a living entity does not have the specified attribute.

Examples
if mob lacks attack_damage:

Block

%b:BLOCK% type (is|is not) %mat:MATERIAL%
Block
1.0.0

Checks if a block's type matches or does not match the given material.

Examples
if block type is stone:
if block type is not air:
%b:BLOCK% (is|is not) (solid|passable)
Block
1.0.0

Checks if a block is or is not solid.

Examples
if block is solid:
if block is not solid:
%b:BLOCK% (is|is not) (air|empty)
Block
1.0.0

Checks if a block is or is not air (empty).

Examples
if block is air:
if block is not air:

Event

[this] (is|is not) [already] cancelled
Event
1.0.0

Checks if the current event is cancelled. Only works inside cancelable event handlers.

Examples
if this is cancelled:

Inventory

%b:BLOCK% inventory (is|is not) empty
Inventory
1.0.0

Checks if a container block's inventory is or is not empty.

Examples
if block inventory is empty:
if block inventory is not empty:
%b:BLOCK% is [a] container
Inventory
1.0.0

Checks if a block is a container (chest, barrel, hopper, etc.).

Examples
if block is a container:
slot %slot:INT% of %inv:EXPR% is empty
Inventory
1.0.0

Checks if a specific slot in an inventory contains no item.

Examples
if slot 0 of gui is empty:
slot %slot:INT% of %inv:EXPR% is not empty
Inventory
1.0.0

Checks if a specific slot in an inventory contains an item.

Examples
if slot 0 of gui is not empty:
%inv:EXPR% inventory is empty
Inventory
1.0.0

Checks if a custom inventory is completely empty.

Examples
if gui inventory is empty:
%inv:EXPR% inventory is not empty
Inventory
1.0.0

Checks if a custom inventory contains at least one item.

Examples
if gui inventory is not empty:
%inv:EXPR% inventory contains %mat:MATERIAL%
Inventory
1.0.0

Checks if a custom inventory contains at least one item of the given material.

Examples
if gui inventory contains diamond:
%inv:EXPR% inventory does not contain %mat:MATERIAL%
Inventory
1.0.0

Checks if a custom inventory does not contain any item of the given material.

Examples
if gui inventory does not contain diamond: