Minecraft Maps / Redstone Device

Execute Commands Relative To Blocks (@b) [14w21b]

  • 5,793 views, 0 today
  • 68 downloads, 0 today
  • 10
  • 2
  • 4
Lmeagno's Avatar Lmeagno
Level 66 : High Grandmaster Button Pusher
Here are a series of commands that will allow you to /execute relative to a specific block. (Tested in 14w21b)
Remember to leave a Diamond to show your support!
/scoreboard objectives add BlockExecute dummy

/fill ~7 ~-1 ~ ~ ~-1 ~ redstone_block
/fill ~7 ~1 ~ ~ ~1 ~ <bedrock>

/execute @a ~-2 ~-2 ~-2 /fill ~ ~ ~ ~4 ~4 ~4 double_plant 0 replace
/execute @a ~-4 ~-4 ~-4 /fill ~ ~ ~ ~8 ~8 ~8 double_plant 0 replace

/scoreboard players set @e[type=Item] BlockExecute 1 {Age:0s,Item:{id:minecraft:double_plant}}

/execute @e[score_BlockExecute=1,score_BlockExecute_min=1] ~ ~ ~ <COMMAND(S)> 

(optional) /execute @e[score_BlockExecute=1,score_BlockExecute_min=1] ~ ~ ~ /setblock ~ ~ ~ <BLOCK>

/kill @e[score_BlockExecute=1,score_BlockExecute_min=1]

/scoreboard players reset * BlockExecute

Relative to the player, a /fill replace command is executed. This replaces all of the blocks of the player's choosing with a "double_plant" block. When updated, the double_plant block will break into an item and from this entity we execute our commands.
After the commands have been executed the double_plant item is destroyed and the scoreboard is reset.

Special thanks to dandamannnnn for his Destroy Specific Blocks command set up.
Progress100% complete

3 Update Logs

Schematic Update : by Lmeagno 06/14/2014 11:07:57 amJun 14th, 2014

The schematic is now available!

Create an account or sign in to comment.

05/16/2014 8:43 am
Level 33 : Artisan Engineer
Jmal116's Avatar
It's a cool idea, but its a bit over complicated. The tildes (~) after the execute part are there for a reason, they allow you to offset where the command is executed. So what you could do is place an invulnerable squid (or some other non-moving mob) below a block, and then simply use execute on the mob, just with a offset of about 5 block up, depending on where you put it.
05/16/2014 8:51 am
Level 66 : High Grandmaster Button Pusher
Lmeagno's Avatar
That is true, and that is the technique I used fo my last two designs. However, this is a command that will execute at any block in the world, even ones placed by the player, without any need to manually spawn the entity.
04/23/2014 9:45 am
Level 18 : Journeyman Engineer
TechProGaming3000's Avatar
Nice idea, but it would be more useful if it was multiplayer-friendly...
04/23/2014 3:02 pm
Level 66 : High Grandmaster Button Pusher
Lmeagno's Avatar
It technically is possible. But it could be more complicated and require more command blocks.
Summon a WitherSkull relative to where the block is (i.e. instead of the /particle command) and have the WitherSkull set a score of the player who summoned it so the command would only activate for players with that score.
However, if I did this there would be twice as many command blocks and the time it would take to activate would be both longer and unreliable.
Planet Minecraft


© 2010 - 2024