execute if entity @s[type=player,gamemode=!spectator,team=blue] if entity @n[tag=flame_temp,tag=red] run damage @s 1 minecraft:on_fire
execute if entity @s[type=player,gamemode=!spectator,team=red] if entity @n[tag=flame_temp,tag=blue] run damage @s 1 minecraft:on_fire

execute if entity @s[type=!player,team=blue] if entity @n[tag=flame_temp,tag=red] run damage @s 8 minecraft:on_fire
execute if entity @s[type=!player,team=red] if entity @n[tag=flame_temp,tag=blue] run damage @s 8 minecraft:on_fire

execute if entity @s[type=!player,team=!blue,team=!red] run damage @s 8 minecraft:on_fire

execute if entity @s[type=!player,team=blue] if entity @n[tag=flame_temp,tag=red] run data merge entity @s {Fire:60s}
execute if entity @s[type=!player,team=red] if entity @n[tag=flame_temp,tag=blue] run data merge entity @s {Fire:60s}
execute if entity @s[type=!player,team=!red,team=!blue] run data merge entity @s {Fire:60s}

execute if entity @s[nbt={HurtTime:10s}] run particle minecraft:lava ~ ~ ~ 0 0 0 0 1 normal