execute unless entity @s[gamemode=creative] run item modify entity @s weapon.mainhand pctf:remove1
summon marker ~ ~1.4 ~ {Tags:["check_proj","flame_thrower","new"],CustomName:'"flame_thrower"'}
tag @s add temp
execute as @n[tag=flame_thrower,tag=new] at @s rotated as @n[tag=temp] run tp @s ~ ~ ~ ~ ~
tag @s remove temp

execute if entity @s[team=blue] run tag @n[tag=new] add blue
execute if entity @s[team=red] run tag @n[tag=new] add red

execute store result storage pctf:angle input.x int 1 run random value -8..8
execute store result storage pctf:angle input.y int 1 run random value -8..8

execute as @n[tag=new] at @s run function pctf:logic/items/flamethrower/init with storage pctf:angle input

tag @n[tag=new] remove new

playsound minecraft:entity.blaze.shoot player @a ~ ~ ~ 0.5 2

scoreboard players set @s item_cooldown 5