Skip to main content
2 of 2
replaced http://minecraft.gamepedia.com/ with https://minecraft.wiki/w/

What you are looking for is the amazing execute command:

Executes a command on behalf of one or more other entities, with originating permissions, optionally on condition that a single-block /testforblock-style check passes.

The syntax is:

execute <entity> <x> <y> <z> <command …> 

<entity> is a target selector, such as @a, <x> <y> <z> are coordinates from which to execute the following <command …> from. In most cases, setting this to ~ ~ ~ (i.e. the exact location of the entity) is fine. To set the block under every player to air, you can use

execute @a ~ ~ ~ setblock ~ ~-1 ~ air
MrLemon
  • 17.4k
  • 6
  • 60
  • 83