I was thinking of something like /execute @e[type=snowball] ~ ~ ~ summon LightningBolt (using a redstone clock), but I realized that it would just keep spawning lighting until it disappeared. What I want is the lightning to spawn where it LANDED. Possible?
Edit:
Tried it, it does look cool even if it isn't what I wanted.
don't know if you could use it but this video uses the falling sand mechanic. maybe retrofit it somehow into your idea. This one tp's falling sand to an exp orb by detecting the newest exp orb in the world. Also note that a thrown snow ball has a different id then a held one.
I'm thinking we should switch to a wither skull. I tried that earlier but it despawns very quickly, so using execute doesn't work. How could we make wither skulls last longer than 1 tick?
Edit:
Didn't see your thing Maxaxik. I'll try that.
Edit 2:
Maxaxik, you're idea really helped, thanks.
Do exactly as said.
Make sure the commands are run in this order. Meaning "1" should be towards the negative coords, "6" towards the positive. Create the objective "timer" as a dummy.
Now run the command relative to "@e[type=ArmorStand,name=SnowballHit". In this case, it would be:
"/execute @e[type=ArmorStand,name=SnowballHit] ~ ~-2 ~ /summon LightningBolt ~ ~ ~"
There you have it. A LightningBolt will be fired at where the snowball lands.
Yeah, I'm working on a minigame and this is exactly what I needed. After a while of experimenting, I got exactly what I wanted.
PS: VERY IMPORTANT!
"y" should be "~-2" as the ArmorStand is actually 2 blocks above where the snowball lands. This is due to the fact that the snowball will collide with the ArmorStand markers if the were summoned at the exact position.
I already did that for you in the above command, but if you wish to use the same concept for something else, remember to run the command 2 blocks lower than the location you wish to execute at.
Edit:
Tried it, it does look cool even if it isn't what I wanted.
Lightning is an entity, but it only lasts a few seconds. I can't tp lightning to the snowball every tick, because it would be gone by then.
However, if I can find a way to tp falling sand 1 block above/below the snowball, it could work.
I'm thinking we should switch to a wither skull. I tried that earlier but it despawns very quickly, so using execute doesn't work. How could we make wither skulls last longer than 1 tick?
Edit:
Didn't see your thing Maxaxik. I'll try that.
Edit 2:
Maxaxik, you're idea really helped, thanks.
That guy is loud as hell.
Do exactly as said.
Make sure the commands are run in this order. Meaning "1" should be towards the negative coords, "6" towards the positive. Create the objective "timer" as a dummy.
1. /scoreboard players add @e[type=ArmorStand,name=SnowballNoHit] timer 1
2. /scoreboard players add @e[type=ArmorStand,name=SnowballHit] timer 1
3. /execute @e[type=Snowball] ~ ~2 ~ /kill @e[type=ArmorStand,name=SnowballNoHit,r=2]
4. /execute @e[type=Snowball] ~ ~2 ~ /summon ArmorStand ~ ~ ~ {CustomName:SnowballNoHit,NoGravity:1,Invisible:1}
5. /entitydata @e[type=ArmorStand,name=SnowballNoHit,score_timer_min=1] {CustomName:SnowballHit}
6. /kill @e[type=ArmorStand,name=SnowballHit,score_timer_min=2]
Now run the command relative to "@e[type=ArmorStand,name=SnowballHit". In this case, it would be:
"/execute @e[type=ArmorStand,name=SnowballHit] ~ ~-2 ~ /summon LightningBolt ~ ~ ~"
There you have it. A LightningBolt will be fired at where the snowball lands.
Yeah, I'm working on a minigame and this is exactly what I needed. After a while of experimenting, I got exactly what I wanted.
PS: VERY IMPORTANT!
"y" should be "~-2" as the ArmorStand is actually 2 blocks above where the snowball lands. This is due to the fact that the snowball will collide with the ArmorStand markers if the were summoned at the exact position.
I already did that for you in the above command, but if you wish to use the same concept for something else, remember to run the command 2 blocks lower than the location you wish to execute at.