Minecraft/Commands/execute

From Wikibooks, open books for an open world
Jump to navigation Jump to search

Example: /execute @e ~~~ setblock ~~~ glass_block places a glass block at the feet of all players, mobs, boats, minecarts, armour stands, ect..

Syntax:

/execute <target: selector (required)> <position: coordinates (required)> <command (required)>

The target is the entity(s) to effect. The position is where to run the command from, according to target, so ~~~ means where the target is. The command is any command, even another /execute command, may be placed.