Minecraft – Execute command relative to block

minecraft-commandsminecraft-java-edition

Is it possible to execute commands relative to a block? For example, if I have a stone block and I want to execute a particle command at it, how can I do that? I do know how to use the execute command, it's used like this:

/execute <target> ~ ~ ~ /<command>

Unfortunately, I don't know how to do this relative to a block. How can I do this? Is this possible? As always, all help is appreciated, thanks!

Best Answer

if you know the location of the block relative to the command block, you can simply do /execute ~ ~ ~ /[command] and execute the particle effect spawning command at a space relative to the command block, so if you bury it 5 blocks deep and want to make the stone above it smoke, i think you'd do ~0 ~0 ~5 for the location, you'll have to experiment with this on your own, for further details, please look on youtube for "Sethbling" and look at his previous snapshot videos, in which he covered the particle effect feature of the command block.