Fireball-shooting weapon
Hi all. I'm starting work on a datapack project where one of the things within is a sword that, when right-clicked, shoots a fireball in the direction the player is looking. I've watched a few videos, browsed where I can, but have yet to find a means in which to make this happen as my playtesting never seems to properly work.
Below is the relevant code relating to the attempt - I've tested a few different items, the shield is just a current attempt:
execute as @a[scores={fireball=1..},nbt={SelectedItem:{id:"minecraft:shield",tag:{dragonblade:1b}}}] at @s run summon minecraft:fireball ~ ~1 ~ {power:[0.0,0.5,-20.0],ExplosionPower:3} scoreboard players remove @a[scores={fireball=1..}] fireball 1``` Any suggestions or help is appreciated. Trying to find my footing with datapacks.