Lightning Stick

A stick that can summon lightning when you hit an entity!

Supported Versions:

1.21

Commands by Row:

Row 1

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

Row 2

2. [impulse] /scoreboard objectives add lightningDamage minecraft.custom:minecraft.damage_dealt

Row 3

3. [repeat] /execute as @a at @s if entity @s[nbt={SelectedItem:{id:"minecraft:stick",components:{"minecraft:custom_data":{light:1}}}}] if score @s lightningDamage matches 1.. run execute at @e[nbt={HurtTime:10s},distance=..5,sort=nearest,limit=1] run summon minecraft:lightning_bolt ~ ~ ~
4. [chain conditional] /execute as @a at @s if score @s lightningDamage matches 1.. run scoreboard players reset @a

Preview

impulse
impulse
repeat
chain

Video

Too lazy to copy and paste each command?