execute if entity @e[tag=shotgunbullet,distance=..7.5] run particle crit ~ ~ ~ 0 0 0 0 1 force
execute if entity @e[type=spectral_arrow,tag=shotgunbullet] as @e[dx=0,tag=!ignoredmg,type=!#survivalplus:notalive] positioned ~-0.99 ~-0.99 ~-0.99 if entity @s[dx=0] run effect give @s glowing 10

execute store result score power burst run data get entity @s SelectedItem.components."minecraft:enchantments"."minecraft:power"

execute unless data entity @s SelectedItem.components."minecraft:enchantments"."minecraft:power" run function survivalplus:tools/archer/arrow/shotgun/0
execute if score power burst matches 1 run function survivalplus:tools/archer/arrow/shotgun/1
execute if score power burst matches 2 run function survivalplus:tools/archer/arrow/shotgun/2
execute if score power burst matches 3 run function survivalplus:tools/archer/arrow/shotgun/3
execute if score power burst matches 4 run function survivalplus:tools/archer/arrow/shotgun/4
execute if score power burst matches 5.. run function survivalplus:tools/archer/arrow/shotgun/5
scoreboard players reset power

execute if entity @e[tag=shotgunbullet,distance=..9] if block ^ ^ ^.3 #survivalplus:nobounce positioned ^ ^ ^.3 run function survivalplus:tools/archer/arrow/shotgunbullet
tag @e remove ignoredmg