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.
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 a lightning
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:
scoreboard players set @a lightning 1 {SelectedItem:{id:minecraft:snowball,tag:{display:{Name:"KABOOM"}}}}
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:
scoreboard players set @a lightning 0 {SelectedItem:{id:minecraft:snowball}}
From here, we can set the score of the snowball entities near these players using execute
:
execute @a[score_lightning_min=1] ~ ~ ~ scoreboard players add @e[type=Snowball,r=10] lightning 0
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:
execute @e[type=Snowball,score_lightning_min=0] ~ ~ ~ summon LightningBolt ~ ~ ~
The results: Wholly satisfying:
![enter image description here](https://i.stack.imgur.com/L1j2W.png)
Best Answer
In 1.8 you cannot rely on arrows items specifically, as no item data is transferred to the entity.
However, the bow will modify the arrow's
damage
value depending on the Power enchantment level. You can provide the player with a bow containing a specific Power level and then target arrows that have a particular amount of damage.damage
will normally be 2.0. If Power exists on the bow, the value is incremented by 0.5 and then for each level of Power, it will increase by another 0.5. For example, a Power 3 bow would result in a damage value of 4.0.Example bow to provide:
You can assign a score to arrow entities based on their
damage
tag value.Objective to create:
Example commands to run on a clock, assigning scores to specific arrows (Power 3 to Power 5):
And you can target arrows based on their score.