Skip to content
WikilyWIKILY
All games23 Wikis · pick your game
Calculators/execute builder

Switch game

23 Wikis · pick your game
Execute Builder

Calculator

Execute Builder

Build an /execute command step by step: who, where, conditions and stores, with a line in plain words for every step.

Steps, in order

  1. 1as: run as entities
  2. 2at: run where entities are
  3. 3block: a block is there
    block: a block is there

Without a command the chain has to end on a condition: the game then says whether the test passed.

What it does

  1. As each of @a
  2. at where each of @s is (position, rotation, dimension)
  3. only if the block at ~ ~-1 ~ is grass_block
  4. then runs say I am standing on grass

Command

/execute as @a at @s if block ~ ~-1 ~ grass_block run say I am standing on grass

80 characters

For Java Edition 26.3. Every form this tool writes was run through the game's own command parser.

Who, where and how

asWho runs the rest: each entity it finds, one after another
atWhere: the position, rotation and dimension of each entity
positionedOnly the position
rotatedOnly the rotation
facingTurns to look at a point or an entity
alignRounds the position down to the block
anchoredWhether ^ ^ ^ starts at the eyes or the feet
inThe dimension, with the same coordinates
onSwitches to a related entity, like the vehicle or the owner
summonSummons an entity and runs as it

Conditions

blockA block or #tag is at a position
blocksTwo areas hold the same blocks
entityA selector finds anything
scoreA score is in a range, or compares with another
dataAn entity, block or storage has data at a path
itemsAn entity or container holds an item in given slots
predicateA data pack predicate passes
biomeThe biome at a position
dimensionThe dimension it runs in
loadedThe chunk at a position is loaded
functionA function returns something other than 0

Keep the result

scoreA score of each holder
entityA number in an entity's data, times a scale
blockA number in a block entity's data, times a scale
storageA number in command storage, times a scale
bossbarThe value or max of a boss bar

How the game works it out

Order mattersas changes who runs the command but not where; at changes where but not who, so as @a at @s runs at each player
Without runThe chain has to end on a condition; the game then says whether it passed and, for entity tests, how many matched
result or successstore result keeps the command's number, store success keeps 1 if it worked and 0 if not
One entityScores, data and stores that read one entity need @s, @p, @r, @n, a name or limit=1
BranchesEach entity found by as or at runs the rest once; the game rule max_command_forks (65536) caps them
Data pack idspredicate and function take ids from a data pack, which the game checks while reading the command; if function also needs run after it
Checked in the gameEvery subcommand and condition, both ways round, was parsed by the game
Join the creator communityThe people who build the Minecraft Java Edition wiki are on our Discord. Ask questions or suggest pages.Join Discord (opens Discord in a new tab)