âī¸ Conditions
Adding !
before a condition type inverts its logic. For instance:
type: "!permission"
permission: "craftengine.admin"
any_ofâ
Satisfy any one of the conditions.
type: any_of
terms:
- type: xxx
- type: xxx
all_ofâ
All conditions must be satisfied.
type: all_of
terms:
- type: xxx
- type: xxx
invertedâ
Negate the result value of the current condition.
type: inverted
term:
type: xxx
falling_blockâ
Check whether the drop was caused by the block falling.
type: falling_block
survives_explosionâ
Detect whether it is possible to survive the explosion.
type: survives_explosion
match_itemâ
Match the item in hand.
type: match_item
id: "minecraft:iron_pickaxe"
regex: false # whether to use regex matching
type: match_item
id:
- "minecraft:iron_pickaxe"
- "minecraft:stone_pickaxe"
regex: false # whether to use regex matching
match_block_propertyâ
Match the block state property
type: match_block_property
properties:
age: 3
enchantmentâ
Detect the enchantments on the item in hand.
type: enchantment
predicate: minecraft:silk_touch>=1 # > >= = < <=
table_bonusâ
Provide different success probabilities at various enchantment levels.
type: table_bonus
enchantment: minecraft:fortune
chances:
- 0.1
- 0.5
- 0.8
- 1
randomâ
type: random
value: 0.1 # 10%
permissionâ
Checks if the player has the permission
type: permission
permission: "craftengine.admin"
expressionâ
Checks if the expression returns true
type: expression
# https://ezylang.github.io/EvalEx/references/references.html
expression: "<papi:farming_level> >= 10"
string_equalsâ
Determines if the two values are equal
type: string_equals
value1: "<arg:player.name>"
value2: "Player_A"
string_containsâ
Determines if value1 contains value2
type: string_contains
value1: "<arg:player.name>"
value2: "A"
string_regexâ
Determines if value matches the pattern
type: string_regex
value: "<arg:player.name>"
regex: "[a-Z]"
is_nullâ
Checks if the argument is null
type: is_null
argument: "player.main_hand_item"
handâ
Checks the interaction hand
type: hand
hand: main_hand # off_hand
on_cooldownâ
Checks if player is on cooldown (use set_cooldown
function to set cooldown for player)
type: on_cooldown
id: my_cooldown_id
Example usage
events:
- on: right_click
functions:
- type: set_cooldown
id: test
time: 30s
- type: command
command: give <arg:player.name> minecraft:apple
conditions:
- type: "!on_cooldown"
id: test
More conditions are coming...