0

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!

3
  • I assume the location of the block in question is not fixed? I.e. a player places a block of Awesomium (renamed diamond block), and there's a creeper shaped particle explosion?
    – MrLemon
    Commented Jun 4, 2014 at 10:12
  • @MrLemon Yeah, something like that... Commented Jun 4, 2014 at 12:02
  • Why the downvote? Is there something I should add? Commented Jun 4, 2014 at 12:11

1 Answer 1

1

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.

1
  • This is cool, I thought there was an actual command to testfor a block, but this cooler, and more efficient too. Commented Jun 4, 2014 at 12:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.