scoreboard players add @s[tag=!jjc_reward] jjc_404 1
execute at @s[tag=jjc_yrjjc] run function colosseum_of_fools:ks/yrjjc/main
execute at @s[tag=jjc_dyjjc] run function colosseum_of_fools:ks/dyjjc/main
execute at @s[tag=jjc_zejjc] run function colosseum_of_fools:ks/zejjc/main
scoreboard players add @s[scores={jjc_404=1..}] jjc_505 1
scoreboard players add @s[scores={jjc_404=41..}] jjc_606 1
execute unless score disable_mob_glowing jjc_main matches 1.. at @s[scores={jjc_404=600..}] unless entity @e[type=#colosseum_of_fools:mob,tag=jjc_mob,distance=..100,tag=jjc_boss] run effect give @e[type=#colosseum_of_fools:mob,tag=jjc_mob,distance=..100,tag=!jjc_boss,nbt=!{Size:0}] glowing 2 0 true
execute unless score disable_mob_glowing jjc_main matches 1.. at @s[scores={jjc_404=2400..}] unless entity @e[type=#colosseum_of_fools:mob,tag=jjc_mob,distance=..100,tag=jjc_boss] run kill @n[type=#colosseum_of_fools:mob,tag=jjc_mob,distance=..100,tag=!jjc_boss,predicate=!colosseum_of_fools:ss/target]

execute store result score @s jjc_mobs_count if entity @e[type=#colosseum_of_fools:mob,tag=jjc_mob,distance=..100,nbt=!{Size:0,DeathTime:0s},tag=!jjc_vex]
execute at @s[tag=jjc_next,scores={jjc_mobs_count=..0}] run function colosseum_of_fools:ks/next
execute unless entity @p[tag=jjc_p,distance=..100] run tag @s add jjc_end
execute at @s[tag=jjc_end,tag=!jjc_reward] run function colosseum_of_fools:ks/end
execute if entity @n[distance=..200,type=block_display,tag=jjc_pt_down_fast,scores={jjc_303=60..}] positioned ~-17 ~ ~-17 run effect give @a[dx=33,dz=33,dy=0,nbt={OnGround:0b},predicate=colosseum_of_fools:ss/falling] slow_falling 1 0 false
execute if entity @n[distance=..200,type=block_display,tag=jjc_pt_down_fast,scores={jjc_303=60..}] positioned ~-17 ~ ~-17 run effect clear @a[dx=33,dz=33,dy=0,nbt={OnGround:1b}] slow_falling

execute if entity @e[type=#colosseum_of_fools:guanzhong,tag=jjc_guanzhong] run schedule function colosseum_of_fools:e/guanzhong/1 1t replace