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.3, 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.
Recorded in-game checks for /execute: Java 26.2 (2026-07-14) and Bedrock 1.26.30 (2026-07-15). These historical checks cover recorded examples, not every generated command or current releases.
Bedrock 1.26.62 (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.3 | Bedrock 1.26.62 |
|---|---|---|
| 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.