Using just a handful of basic commands, you can make almost anything you can imagine with this basic setup. Feel free to ask questions in the comments!
Commands:
Generator: https://docs.google.com/spreadsheets/...
Setup:
/scoreboard objectives add gun minecraft.used:minecraft.carrot_on_a_stick
/give @s minecraft:carrot_on_a_stick{display:{Name:'"Gun"'}}
Beginning:
execute at @a[scores={gun=1..},nbt={SelectedItem:{tag:{display:{Name:'"Gun"'}}}}] run summon minecraft:area_effect_cloud ~ ~1.8 ~ {Duration:100,Tags:['gun1']}
execute as @e[tag=gun1] at @s rotated as @p[distance=..2] run tp @s ~ ~ ~ ~ ~
Middle:
execute as @e[tag=gun1] at @s if block ^ ^ ^1 air run tp @s ^ ^ ^1
execute as @e[tag=gun1] at @s if block ^ ^ ^1 air run particle minecraft:crit ~ ~ ~ 0 0 0 0 1 force @a
End:
execute as @e[tag=gun1] at @s unless block ^ ^ ^1 air run summon tnt
execute as @e[tag=gun1] at @s unless block ^ ^ ^1 air run kill @s
scoreboard players set @a gun 0
Music Used:
Outro: Pachelbel Canon in D