advancement revoke @s only subchronos:fireball

#Cooldown
    execute if score @s fireballCooldown matches 1.. run return run scoreboard players set @s fireballCooldown 2
    scoreboard players set @s fireballCooldown 2

#Removes the used fireball
    execute unless data entity @s SelectedItem.components."minecraft:custom_data"{fireball:1b} run item modify entity @s weapon.offhand subchronos:-1
    execute if data entity @s SelectedItem.components."minecraft:custom_data"{fireball:1b} run item modify entity @s weapon.mainhand subchronos:-1

#Summons fireball
    execute anchored eyes run summon minecraft:fireball ^ ^.2 ^1 {Tags:["fireball","fireball.ini","lifetime_act"],ExplosionPower:1}

#Calculates motion
    execute rotated as @s positioned 0 0 0 align xyz run summon minecraft:marker ^ ^ ^2 {Tags:["fireball.stand"]}

    data modify entity @e[type=minecraft:fireball,tag=fireball.ini,limit=1] Motion[0] set from entity @e[type=minecraft:marker,limit=1,tag=fireball.stand] Pos[0]
    data modify entity @e[type=minecraft:fireball,tag=fireball.ini,limit=1] Motion[1] set from entity @e[type=minecraft:marker,limit=1,tag=fireball.stand] Pos[1]
    data modify entity @e[type=minecraft:fireball,tag=fireball.ini,limit=1] Motion[2] set from entity @e[type=minecraft:marker,limit=1,tag=fireball.stand] Pos[2]

#SFX
    playsound minecraft:block.fire.extinguish ambient @a ~ ~ ~ 1 2
    playsound minecraft:item.flintandsteel.use ambient @a ~ ~ ~ 1 0.6
    playsound minecraft:entity.blaze.shoot ambient @a ~ ~ ~ 1 1.15


#Lifetime
scoreboard players set @e[tag=fireball.ini] lifetime 4

#Removes trash
kill @e[type=minecraft:marker,tag=fireball.stand]
tag @e[tag=fireball.ini] remove fireball.ini