0

I'm trying to make a setup with command blocks that summons lightning at the location of a shot arrow. The setup should recognize the arrow that is shot or the bow that is used by its name or another property, so that lightning only strikes at that specific arrow.

Also, the lightning should only strike once when the arrow hits the ground. I know this is somehow possible with scoreboard, but I'm no good with that. Does anyone know how to make a Lightning Bow in vanilla Minecraft?

  • See this: youtube.com/watch?v=vxDi41dmgMc – Ave Aug 22 '15 at 21:31
  • possible duplicate of How does one make a lightning sword in vanilla Minecraft? – shanodin Aug 22 '15 at 21:54
  • 4
    Two main reasons this is not a duplicate. Firstly, The "dupe" is asking how to make a entirely different weapon, and the answer would be different. Secondly, the dupe-suggestion has no answers, which AFAIK adds further limitations to labelling it as a duple – user106385 Aug 23 '15 at 0:27
  • That other one, is mine too. I didn't get any answers but I did get things like "i'm pretty sure you can't do exactly where you are clicking, as there is no way to detect it using command blocks, but you can do it relative to entities that you aim at." Someone suggested this so I hope this way, there will be an answer. – Jaïr Paalman Aug 23 '15 at 12:52
4

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
-3

1.9 command

Repeat command block (always active):

/testfor @e[type=Arrow] {inGround:1b}

Chain command block (always active, conditional):

/execute @e[type=Arrow] ~ ~ ~ /summon LightningBolt

Chain command block (always active, conditional):

/kill @e[type=Arrow]
  • This not only doesn't fully answer the OP's question, it also ensures a lot of conflicting targeting since you're only testing for the existence of an arrow but aren't targeting the correct arrows afterwards. /testfor is not useful here. – Skylinerw Apr 30 '16 at 7:11

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.