Minecraft /execute builder
Commands
Build /execute commands and inspect existing onesLearn more
Build /execute step by step: choose the executor, position, conditions, and final action. Read a plain-English explanation, or paste an existing command to break it down and find why it does nothing.
My Game select version
Save your preferences in this browser and apply them to supported tools. Settings in a shared link take priority. Wiki version labels are not affected.
Already have a command? Paste it to fill in the form
How to use the result
- In chat
With operator permissions or 'Allow cheats' in single-player. Chat can hold 256 characters — only command blocks can be longer.
- Using a command block
For continuous checks, set the command block to Repeat and Always Active. Without a run clause, a comparator can read whether the condition succeeded.
- In the data pack function
A line without '/' — a ready function string. A data pack with commands will run it on a timer or upon entry.
What to know about /execute
- as changes 'who', at changes 'where'. as @a without at @s will execute the command on behalf of each player, but at the command block's location. Both are usually needed: as @a at @s.
- The order of steps is important. as @a at @s — each player at their own location. at @s as @a — all players, but at the executor's location.
- Several goals — multiple runs. as @e[type=cow] will execute everything below once per cow.
- A condition without 'run' — a check. Command checks whether a condition is met, while a command block sends a signal to a comparator.
- store outputs the result of run. For example, how many items were found clear: store result score @s found run clear @s diamond 0.
What @a, @p and their arguments mean — in target selectors, score for if score will be set /scoreboard display. Information about command blocks — in wiki.
Frequently asked questions
Why doesn't execute as @a work with coordinates ~?
as changes only the player executing the command, the location remains unchanged — either the command block's location or the player who entered the command. To make ~ ~ ~ apply to each player, after as, use at @s.
What's the difference between 'as' and 'at' in the execute command?
as sets who executes the command — who will be @s. at moves the point, rotation, and position to the target location, but does not change the executor. They are often used together: as @a at @s.
How to check the block below the player with execute?
Steps as @a at @s if block ~ ~-1 ~ and id of the block, and at the end run with the required command. ~ ~-1 ~ — the block directly below the player's feet.
