Minecraft Java and Bedrock Execute Command Generator
Use this Execute Command Generator to visually build chains of sub-conditions in Minecraft Java and Bedrock Edition 1.21+ and 26+. Add modifiers like as, at, positioned, rotated, and align, combine them with if / unless conditions, and define the final command to be executed.
Select your Minecraft edition:
Chained Sub-conditions
Final Command
Visualization
Generated Command
Want to create a cheap Minecraft server without lag?
I recommend Sparked Host: affordable plans, great performance, easy dashboard, and fast support.
🚀 Create server on Sparked HostHow to Use the Execute Command in Minecraft
The Execute command allows you to chain context modifiers (who executes, from where, looking where) and conditions (if/unless) before running another command.
A basic example in Java Edition:
/execute as @a at @s run say Hello, world!
This command makes every player (@a) run the say command from their own position (at @s).
Execute Command Examples
Teleport a player to another
/execute as @p at @p run tp @s ~ ~10 ~
Execute only if there is a zombie nearby
/execute if entity @e[type=zombie,distance=..5] run say Zombie nearby!
Compare a scoreboard score
/execute if score @p counter matches 10.. run say Counter reached 10!
Execute from on top of a specific block
/execute if block ~ ~-1 ~ minecraft:diamond_block run say You are standing on diamond!
Frequently Asked Questions
What is the execute command used for in Minecraft?
The execute command allows you to chain context modifiers (such as target, position, and rotation) and conditions before running another command.
What is the difference between 'as' and 'at' in the execute command?
The 'as' modifier changes who executes the subsequent command, while 'at' changes the position, dimension, and rotation of the execution based on the target.
Does execute work the same way in Bedrock Edition?
The chained syntax (as, at, if, run) is practically identical between Java and Bedrock, but some features like 'store' and 'predicate' only exist in Java Edition.
How do you compare scores with 'if score'?
Use 'if score' followed by the target and objective, a comparison operator, and another target and objective, or use 'matches' to compare it against a range of values.
Can I use more than one sub-condition in the same command?
Yes, you can chain as many sub-conditions as necessary before the final 'run' keyword.