Changes execution context and runs a command.
/execute asat run
| Name | Required | Description |
|---|---|---|
| target | Yes | Entity to execute as/at. |
| command | Yes | Command to run under the new context. |
/execute as @a at @s run say Hello /execute if block ~ ~-1 ~ minecraft:diamond_block run say On diamond
if / unless to gate execution.Major syntax overhaul occurred in Java 1.13.