Lightning Bow

A bow that can shoot lightning arrows!

Supported Versions:

1.21

Commands by Row:

Row 1

1. [impulse] /give @p bow[minecraft:custom_data={light:1},minecraft:item_name="Lightning Bow"]

Row 2

2. [impulse] /scoreboard objectives add bow minecraft.used:minecraft.bow

Row 3

3. [repeat] /execute as @a at @s if entity @s[nbt={SelectedItem:{id:"minecraft:bow",components:{"minecraft:custom_data":{light:1}}}}] if score @s bow matches 1.. run tag @e[type=arrow,distance=..2,sort=nearest,limit=1] add lightningArrow
4. [chain] /execute as @e[tag=lightningArrow,nbt={inGround:1b}] at @s run summon minecraft:lightning_bolt ~ ~ ~
5. [chain] /execute as @e[tag=lightningArrow,nbt={inGround:1b}] at @s run kill @s
6. [chain] /execute as @a at @s if score @s bow matches 1.. run scoreboard players reset @s bow

Preview

impulse
impulse
repeat
chain
chain
chain

Video

Too lazy to copy and paste each command?