This is a reference for the built-in shogi effects available in the default scope.
is_player or can_see_sky'minecraft:the_nether' or 'inventory_button'clamp($value, 0, 27) or named arguments like if(condition = is_player, then = true, else = false), but do not mix the two styles in one callFor operator syntax, grouping, variables, and general expression rules, see Rule Expression Format.
if(condition, then, else) chooses between two branches based on a condition. Example: if(condition = is_dimension('minecraft:the_nether'), then = 180, else = 220)not(condition) negates a condition, but in expressions !condition is usually shorter. Example: !is_player -> failure('Players only')and(...) requires every condition to match, but in expressions + is the usual syntax. Example: is_player + can_see_sky -> trueany(...) matches when any listed condition matches, but in expressions , is the usual syntax. Example: is_dimension('minecraft:the_nether'), is_dimension('minecraft:the_end') -> 256use(identifier) imports another named Shogi rule by id. Example: use('pack:shared_cost_rule')clamp(value, min, max) keeps a computed value inside a range. Example: clamp($distance * 0.01, 0, 27)clamp_min(value, min) raises a value up to a minimum floor. Example: clamp_min($height, 64)clamp_max(value, max) lowers a value down to a maximum ceiling. Example: clamp_max($height, 256)any_hand(condition) checks the player's main hand and offhand against the same nested condition. Example: any_hand(has_enchantment('minecraft:silk_touch')) -> trueoffhand(effect) evaluates a nested effect using the player's offhand item context. Example: offhand(is_item('minecraft:totem_of_undying')) -> trueis_player matches when the current entity context is a player. Example: is_player -> truehas_entity_tag(tag) checks whether the current entity has a given entity tag. Example: has_entity_tag('example') -> truehas_mob_effect(effect) checks whether the current entity has a matching status effect. Example: has_mob_effect('minecraft:poison') -> trueis_on_any_vehicle matches when the current entity is riding something. Example: is_on_any_vehicle -> dismountis_on_vehicle(vehicle) matches when the current entity is riding a specific vehicle type. Example: is_on_vehicle('minecraft:boat') -> truehas_item(item, count) checks whether the player inventory contains enough matching items, defaulting count to 1. Example: has_item('minecraft:ender_pearl', 2) -> truehas_empty_inventory matches when the player inventory is empty. Example: has_empty_inventory -> trueis_wearing_any_armor matches when the player has any armor equipped. Example: is_wearing_any_armor -> trueis_item(item) checks whether the current item context matches a specific item. Example: is_item('minecraft:elytra') -> damage_item(1)has_enchantment(enchantment, level) checks whether the current item has an enchantment at or above the given level, defaulting level to 1. Example: has_enchantment('minecraft:unbreaking', 3) -> truecan_see_sky matches when the current block position has direct sky access. Example: can_see_sky -> trueis_above_y(y) matches when the current position is above the given Y value. Example: is_above_y(200) -> trueis_below_y(y) matches when the current position is below the given Y value. Example: is_below_y(0) -> failure('Too low')is_at(pos) matches one exact block position. Example: compare against a fixed teleport pad location.is_near(pos, distance) matches when the current position is within range of a target block position. Example: compare against a nearby anchor point with a small radius.is_within(bounds) matches when the current position is inside a bounding box. Example: restrict a rule to a defined safe region.is_dimension(dimension) matches the current dimension id. Example: is_dimension('minecraft:the_end') -> 256is_biome(biome) matches the biome at the current position. Example: is_biome('minecraft:desert') -> trueis_block(block) matches the block at the current position. Example: is_block('minecraft:respawn_anchor') -> trueis_block_state_property(property, value) checks a block-state property at the current position. Example: is_block_state_property('powered', 'true') -> trueis_entity_nearby(entity, distance, min) checks whether enough matching entities are within range, defaulting min to 1. Example: is_entity_nearby('minecraft:villager', 24, 1) -> trueis_animal_nearby(distance, min) checks for nearby animals, defaulting min to 1. Example: is_animal_nearby(16, 3) -> trueis_mob_nearby(distance, min) checks for nearby mobs, defaulting min to 1. Example: is_mob_nearby(12, 1) -> failure('Unsafe area')is_player_nearby(distance, min) checks for nearby players, defaulting min to 1. Example: is_player_nearby(12, 1) -> trueis_near_poi(poi, distance) checks for a nearby point of interest. Example: match when the player is close to a configured village-style POI.failure(message) returns a failure result with a message. Example: failure('You need more XP')refuse(message) returns a refusal result with a message. Example: refuse('This teleport source is disabled')dismount makes the player stop riding. Example: is_on_any_vehicle -> dismountdamage_item(amount) damages the current item stack by a non-negative amount. Example: damage_item(80)item_cost(item, count) consumes matching items from the player inventory, defaulting count to 1. Example: item_cost('minecraft:ender_pearl', 1)xp_points_cost(xp) charges raw experience points from the player. Example: xp_points_cost(12)xp_level_cost(level) charges whole experience levels from the player. Example: xp_level_cost(3)has_advancement(advancement) checks whether the player has completed an advancement. Example: has_advancement('minecraft:story/mine_diamond') -> truehas_cooldown(identifier) checks whether a named Shogi cooldown currently exists. Example: has_cooldown('inventory_button') -> failure('Still cooling down')is_cooldown_above(cooldown, duration) checks whether a cooldown has at least the given remaining duration. Example: is_cooldown_above('inventory_button', '30s') -> trueadd_cooldown(identifier, duration) always adds or refreshes a named cooldown. Example: add_cooldown('inventory_button', '300s')cooldown_cost(identifier, duration) only succeeds when the named cooldown is not already active, unlike add_cooldown, and it only resolves on the server side. Example: cooldown_cost('inventory_button', '300s')