Chain subcommands (as, at, if, unless…) to run a command for each matching entity, on Java and Bedrock.
To send each player a personal chat message in Minecraft Java 26.2, run: /execute as @a run tellraw @s "This message is sent to each of you." Each subcommand in the chain narrows who or where the final command runs, left to right. Choose a built command (like /tellraw) as the tail, or type any command yourself.
Each subcommand narrows who/where the final command runs, left to right.
/execute as @a run tellraw @s "Hello from execute!"Command output is generated for Java 26.2 and Bedrock 1.26.30 and was last paste-verified in-game on 2026-07-10.
Bedrock 1.26.30 (since 1.19.50) supports the same /execute subcommand chaining as Java — the practical differences are the id forms inside conditions and dimensions, and how the tail command is written:
| Feature | Java 26.2 | Bedrock 1.26.30 |
|---|---|---|
| The same chain | /execute as @a run tellraw @s "This message is sent to each of you." | /execute as @a run tellraw @s {"rawtext":[{"text":"This message is sent to each of you."}]} |
| Subcommands | as · at · positioned · facing · align · anchored · in · if · unless | Same on both editions |
| Dimension ids (in …) | minecraft:overworld | overworld |
| Block ids (if block …) | minecraft:diamond_block | diamond_block |
/execute runs another command in a modified context — as a different entity, at a position, or only if a condition is true. It is the backbone of command-block and datapack logic.
Subcommands apply left to right. "execute as @a at @s run …" runs the final command once per player, positioned at each one. Add if/unless to run only when a block, entity or score matches.
Bedrock supports the same subcommand chaining (as, at, positioned, if, unless…). Targets here use @p/@s/@a/@r or a player name; the "type any command" option lets you run any tail command on either edition.