Breaking a block by stepping on it

I'm creating something in Minecraft PE and I want to make it so that when a player steps on a block, the block disappears and doesn't come back. I know how to use command blocks and the fill command, but I can't get it to execute when stepped on.


Solution 1:

great question! You could create a Motion Sensor using command blocks that trigger the /setblock command! Here is how I did it using only 2 command blocks and a redstone repeater: enter image description here The first command block [tan] is the motion sensor. The command /testfor @p[rm=0,r=2] is searching for a player that comes within a 0-2 block radius. The command block is type "Impulse", it is "Unconditional", and its redstone option is set to "Needs Redstone."

The second command block [green] is responsible for changing the block into an air block. The command /setblock 303 64 44 air 0 replace is replacing the block at x y z with an air block. The command block is type "Chain", it is "Conditional", and its redstone option is set to "Needs Redstone"

The repeating circuit is just an observer that is looped and pointed into the first command block. To trigger this circuit, just build the loop and place the final redstone in front of the observer.