2

Ok so when you throw a snowball I have

/execute @e[type=Snowball] /setblock ~ ~-1 ~ minecraft:ice' 

So this makes an ice path following under the snowball. I had some code something like this and it worked but I modified it and accidently broke it. So what is the correct code that I originally had that made this work? I also tried everything like /execute @e[type=Snowball] /setblock minecraft:ice ~ ~-1 ~ and

/execute ~ ~-1 ~ @e[type=Snowball] /setblock minecraft:ice last one I tried was /execute @e[type=Snowball] ~ ~-1 ~ /setblock minecraft:ice

  • This is in a command block (presumably triggered by a fill clock)? You don't need the / for command blocks, and actually, I think it might screw things up for the execute. – MBraedley Dec 9 '14 at 3:12
  • Also, here's the command documentation – MBraedley Dec 9 '14 at 3:13
  • Ok I'll try that and I used the '/' for execute maybe the '/' was screwing it up for setblock. I'll try it and thanks for the link of command documentation – Veritas025 Dec 9 '14 at 15:41
1
/execute @e[type=Snowball] ~ ~ ~ /setblock ~ ~-1 ~ ice

I tested that and it works perfectly fine. I think you do need that / in front of setblock for it to work.

| improve this answer | |
  • / is unnecessary in a command block, it should work with or without. The error that you corrected is putting the execute coordinates in the right place. – SirBenet Mar 17 '15 at 17:07
  • What this fixes is including both sets of coordinates for the execute and for the setblock. All the examples in the question are missing one or the other set of coordinates. (And that is why cargo-cult programming is a bad idea…) – SevenSidedDie Mar 17 '15 at 17:11
-1
execute @e[type=Snowball] setblock ~ ~-1 ~ minecraft:ice

In a command block, the leading / is unnecessary.

In the /execute command, there can't be a / before setblock

| improve this answer | |
  • A / before seblock is fine. This won't work though, because you don't have the execute coordinates. – SirBenet Mar 17 '15 at 17:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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