I think I have it. The operation requires four commands, not counting the fill clock. The arrow will still exist but will spawn fireworks that explode immediately.
Type this in chat:
/scoreboard objectives add ground dummy ground
1st Command Block on fill clock:
/scoreboard players set @e[type=Arrow] ground 0 {inGround:0b}
2nd Command Block on fill clock:
/scoreboard players set @e[type=Arrow] ground 1 {inGround:1b}
3rd Command Block on fill clock:
/execute @e[type=Arrow,score_ground=0] ~ ~ ~ summon FireworksRocketEntity ~ ~ ~ {LifeTime:-1,FireworksItem:{id:401,Count:1,tag:{Fireworks:{Explosions:[{Type:0,Flicker:0,Trail:0,Colors:[0],FadeColors:[0]}]}}}}
You can make your own firework to put in the execute command at http://www.minecraftupdates.com/fireworks but make sure the lifetime is set to -1.
I hope this helped and that this was what you were looking for.
Since Arrows don't contain the data of what bow shot it from, we must mark the arrow as its being shot.
Setup:
/scoreboard objectives add Shot stat.useItem.minecraft.bow
/scoreboard objectives add Holding dummy
/scoreboard objectives add LightingArrow dummy
/scoreboard objectives add InGround dummy
Clock(20tps)
/scoreboard players set @a Holding 0
/scoreboard players set @a Holding 1 {SelectedItem:{tag:{display:{Name:"Lightning Bow"}}}}
/execute @a[score_Shot_min=1,score_Holding_min=1] ~ ~ ~ scoreboard players set @e[type=Arrow,r=2] LightingArrow 1
/scoreboard players set @e[type=Arrow] InGround 1 {inGround:1b}
/execute @e[type=Arrow,score_LightingArrow_min=1,score_InGround_min=1] ~ ~ ~ summon LightningBolt ~ ~ ~
/kill @e[type=Arrow,score_LightingArrow_min=1,score_InGround_min=1]
/scoreboard players set @a Shot 0
Best Answer
Snowballs are a lot of fun aren't they? Well, this is simpler, since your requirements are that a particular sort of snowball will have an arc of lightning bolts across its trajectory, but the principal is the same.
For this, I used a series of 4 commands and 1 setup command. (well, and also
/gamerule commandBlockOutput false
) It works by setting alightning
score for snowball entities holding customly named snowballs, and then summoning a lightningbolt at each of those snowballs. And it's actually a neat little set of commands.First, we need our scoreboard. You can set one up using
/scoreboard objectives add lightning dummy
. From here, we want to be able to perform commands on players holding customly named snowballs:Unfortunately there's no really clean way to invert this sort of command to reset this score, and resetting it for all items would also cause the last snowball in a stack to stop working, so I just reset it for players holding snowballs. As long as the commands execute at the same time, you shouldn't run into any problems, unless you're trying to build a PvP game around this, then you may want to reset this score for everyone just to be safe:
From here, we can set the score of the snowball entities near these players using
execute
:Now you have a marked snowball. Just what we need! The final step to this equation is to slap a
score_lightning_min=0
in the original "make lightning at every snowball entity" command, hook all 4 command blocks up to a clock of some sort (I recommend a/fill
clock, but it's not entirely necessary as long as all of your commands are on the same line of redstone) and we should be set:The results: Wholly satisfying: