tag @a[gamemode=survival,predicate=colosseum_of_fools:in_colosseum] add jjc_gamemode_survival
gamemode adventure @a[gamemode=survival,tag=jjc_gamemode_survival,predicate=colosseum_of_fools:in_colosseum]

tag @a[tag=jjc_p] remove jjc_p
execute as @e[type=marker,tag=jjc_kaishi] at @s run function colosseum_of_fools:ks/main
 
execute if entity @e[type=#colosseum_of_fools:mob2,tag=jjc_mob,tag=!jjc_guanzhong,predicate=colosseum_of_fools:in_colosseum] run function colosseum_of_fools:ss/main
execute if entity @e[type=#colosseum_of_fools:mob,tag=!jjc_spawn,predicate=colosseum_of_fools:in_colosseum] run function colosseum_of_fools:ss/spawn
tag @e[type=#colosseum_of_fools:mob,tag=!jjc_spawn] add jjc_spawn

execute as @e[type=marker,tag=jjc_ender_trap] at @s run particle minecraft:portal ~ ~2.5 ~ 0.5 0.5 0.5 0.5 1 normal
execute as @e[type=marker,tag=jjc_bossbar] at @s run schedule function colosseum_of_fools:e/bossbar/load 2t append

kill @e[type=#colosseum_of_fools:nov,predicate=colosseum_of_fools:nov,tag=jjc_nov]
kill @e[type=armor_stand,tag=jjc_nop,nbt=!{Passengers:[{}]}]

scoreboard players add #1s jjc_main 1
execute if score #1s jjc_main matches 20.. run function colosseum_of_fools:main/1s