scoreboard objectives add DeathCheatTick dummy
scoreboard objectives add DeathCountCheat dummy
scoreboard objectives add Time_Tick dummy
scoreboard objectives add Time_Second dummy
scoreboard objectives add Time_Hour dummy
scoreboard objectives add Time_Minute dummy

scoreboard objectives add Time_Tick2 dummy
scoreboard objectives add Time_Second2 dummy
scoreboard objectives add Time_Hour2 dummy
scoreboard objectives add Time_Minute2 dummy

scoreboard objectives add Death deathCount

scoreboard players add @a[tag=Play,tag=Counting] Time_Tick 1
scoreboard players add @a[scores={Time_Tick=20..},tag=Play] Time_Second 1
scoreboard players set @a[scores={Time_Tick=20..},tag=Play] Time_Tick 0
scoreboard players add @a[scores={Time_Second=60..},tag=Play] Time_Minute 1
scoreboard players set @a[scores={Time_Second=60..},tag=Play] Time_Second 0
scoreboard players add @a[scores={Time_Minute=60..},tag=Play] Time_Hour 1
scoreboard players set @a[scores={Time_Minute=60..},tag=Play] Time_Minute 0

scoreboard players add @a[tag=Play,tag=Counting] Time_Tick2 1
scoreboard players add @a[scores={Time_Tick2=20..},tag=Play] Time_Second2 1
scoreboard players set @a[scores={Time_Tick2=20..},tag=Play] Time_Tick2 0
scoreboard players add @a[scores={Time_Second2=60..},tag=Play] Time_Minute2 1
scoreboard players set @a[scores={Time_Second2=60..},tag=Play] Time_Second2 0
scoreboard players add @a[scores={Time_Minute2=60..},tag=Play] Time_Hour2 1
scoreboard players set @a[scores={Time_Minute2=60..},tag=Play] Time_Minute2 0

execute as @a[tag=!Cheat,tag=Play] run title @s actionbar ["",{"text":"Death: ","color":"green"},{"score":{"name":"@s","objective":"Death"},"color":"yellow"},{"text":" Time: ","color":"green"},{"score":{"name":"@s","objective":"Time_Hour"},"color":"yellow"},{"text":"h ","color":"yellow"},{"score":{"name":"@s","objective":"Time_Minute"},"color":"yellow"},{"text":"m ","color":"yellow"},{"score":{"name":"@s","objective":"Time_Second"},"color":"yellow"},{"text":"s","color":"yellow"}]
execute as @a[tag=Cheat,tag=Play] run title @s actionbar ["",{"text":"Death: ","color":"dark_blue"},{"score":{"name":"@s","objective":"Death"},"color":"dark_red"},{"text":" Time: ","color":"dark_blue"},{"score":{"name":"@s","objective":"Time_Hour"},"color":"dark_red"},{"text":"h ","color":"dark_red"},{"score":{"name":"@s","objective":"Time_Minute"},"color":"dark_red"},{"text":"m ","color":"dark_red"},{"score":{"name":"@s","objective":"Time_Second"},"color":"dark_red"},{"text":"s - Cheat","color":"dark_red"}]


#Cheat Detection
execute as @a[gamemode=creative] run tag @a add Cheat
execute as @a[gamemode=spectator] run tag @a add Cheat

execute as @a[tag=Play] unless score @s Time_Tick = @s Time_Tick2 run tag @a add Cheat 
execute as @a[tag=Play] unless score @s Time_Second = @s Time_Second2 run tag @a add Cheat
execute as @a[tag=Play] unless score @s Time_Minute = @s Time_Minute2 run tag @a add Cheat
execute as @a[tag=Play] unless score @s Time_Hour = @s Time_Hour2 run tag @a add Cheat

execute as @a[scores={DeathCheatTick=1..}] at @s unless block ~ ~-1 ~ gold_block run tag @a add Cheat
execute as @a[scores={DeathCheatTick=1..}] at @s run scoreboard players set @s DeathCheatTick 0
execute as @a[scores={DeathCountCheat=1..}] at @s run scoreboard players set @s DeathCheatTick 1
execute as @a[scores={DeathCountCheat=1..}] at @s run scoreboard players set @s DeathCountCheat 0