tag @s add domain:scan
execute as @s at @s unless entity @e[r=30,tag=domain:active] run scoreboard players set @s domainclash -101
execute as @e[r=15,tag=domain:open,tag=!domain:scan] at @s run scoreboard players set @e[r=15] domainclash 1
execute as @s[scores={domainclash=0}] at @s unless entity @e[r=15,tag=domain:open] run scoreboard players set @s domainclash -100
tag @s remove domain:scan