I'm trying to make a vanilla spleef arena, with a redstone clock attached to a /setblock
command. No matter how I tried, I could not get the command to set the block under the player air. this was the closest I got: /setblock ~ ~-1 ~ air
is there some way I can attach the ~ ~-1 ~
to @p
? If not what is another way to do this?
Minecraft – How to do a /setblock for under a player
minecraft-commandsminecraft-java-edition
Related Topic
- Minecraft – way to determine whether a player is online or offline with command blocks
- Minecraft Java Edition – How to Detect When a Player Attacks Another Player
- Minecraft – How to set a command block in Minecraft 1.9 to send out a redstone signal whenever it detects a player on a specific type of block
- Minecraft Java Edition – Setblock Direction for Redstone Torches in Minecraft 1.13
Best Answer
What you are looking for is the amazing
execute
command:The syntax is:
<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