scoreboard players add @e[type=block_display,tag=jjc_sgl] jjc_202 1

execute as @e[type=block_display,scores={jjc_202=1},tag=jjc_sgl,tag=!jjc_sgl_r] at @s facing entity @n[distance=..200,tag=jjc_jjc] feet run tp @s ~ ~ ~ ~ 0
execute as @e[type=marker,tag=jjc_jjc] at @s positioned ~-1 ~-30 ~-1 as @e[type=block_display,scores={jjc_202=1},tag=jjc_sgl,tag=!jjc_sgl_r,dy=40,dx=1,dz=1] at @s facing entity @p feet run tp @s ~ ~ ~ ~ 0
execute as @e[type=block_display,scores={jjc_202=1},tag=jjc_sgl,tag=!jjc_sgl_r] at @s on passengers run data modify entity @s Rotation set from entity @n[distance=..0.1,tag=jjc_sgl] Rotation

execute as @e[type=block_display,tag=jjc_sgl,scores={jjc_202=1}] at @s if entity @n[distance=..200,tag=jjc_jjc,tag=jjc_om,] run tag @s add jjc_sgl_om

execute as @e[type=block_display,tag=jjc_sgl_om,scores={jjc_202=35}] at @s as @e[distance=..200,limit=2,sort=nearest,tag=jjc_sgl_zhuangshi2] at @s run data merge entity @s {block_state:{Properties:{ominous:"true"}}}
execute as @e[type=block_display,tag=jjc_sgl_2,scores={jjc_202=35}] at @s as @e[distance=..200,limit=2,sort=nearest,tag=jjc_sgl_zhuangshi2] at @s run data merge entity @s {block_state:{Properties:{trial_spawner_state:"active",lit:"true"}}}
execute as @e[type=block_display,tag=jjc_sgl_2,scores={jjc_202=35}] at @s run fill ~ ~ ~ ~ ~ ~ light[level=10] replace air
execute as @e[type=block_display,tag=jjc_sgl_2,scores={jjc_202=51}] at @s as @e[distance=..200,limit=2,sort=nearest,tag=jjc_sgl_zhuangshi2] at @s run data merge entity @s {block_state:{Properties:{trial_spawner_state:"cooldown",lit:"false"}}}
execute as @e[type=block_display,tag=jjc_sgl_2,scores={jjc_202=51}] at @s if block ~ ~ ~ light run fill ~ ~ ~ ~ ~ ~ air replace light[level=10]

execute if entity @e[type=block_display,tag=jjc_sgl1_2] run function colosseum_of_fools:e/sgl/work1
execute if entity @e[type=block_display,tag=jjc_sgl2_2] run function colosseum_of_fools:e/sgl/work2

kill @e[type=block_display,tag=jjc_sgl,scores={jjc_202=70..}]
execute if entity @e[type=block_display,tag=jjc_sgl] run schedule function colosseum_of_fools:e/sgl/main 1t replace