scoreboard players remove @s lifetime 1



execute as @s[nbt={OnGround:0b}] at @s positioned ~ 18 ~ if entity @s[distance=..20] at @s if block ~ 18 ~ structure_void if block ~ ~-1 ~ #hole if block ~ ~-2 ~ #hole if block ~ ~-3 ~ #hole if block ~ ~-4 ~ #hole if block ~ ~1 ~ #hole if block ~ ~2 ~ #hole if block ~ ~-7 ~ #hole if block ~ ~-8 ~ #hole if block ~ ~-9 ~ #hole if block ~ ~-10 ~ #hole run scoreboard players add @s lifetime 20
execute at @s if block ~ ~-1 ~ white_stained_glass run scoreboard players add @s lifetime 10
execute at @s if block ~ ~-1 ~ red_stained_glass run scoreboard players add @s lifetime 5
scoreboard players operation @s lifetime < lifetimeX Stats

scoreboard players add @s[scores={lifetime2=1..}] lifetime 1
scoreboard players remove @s[scores={lifetime2=1..}] lifetime2 1


xp set @s 100 levels
scoreboard players operation @s Temp = @s lifetime
scoreboard players operation @s Temp *= 100 Const
scoreboard players operation @s Temp /= 20 Const
scoreboard players operation @s Temp /= lifetime Stats




execute as @s[scores={Temp=..0}] unless entity @s[nbt={Inventory:[{id:"minecraft:totem_of_undying"}]}] run function mctsts:game/death
execute as @s[scores={Temp=..0}] if entity @s[nbt={Inventory:[{id:"minecraft:totem_of_undying"}]}] run function mctsts:game/items/totem
execute if score oLifetime Stats matches 3.. as @s[scores={Temp=21..}] run item replace entity @s armor.head with air
execute if score oLifetime Stats matches ..2 as @s[scores={Temp=34..}] run item replace entity @s armor.head with air
execute if score oLifetime Stats matches 3.. as @s[scores={Temp=0..20}] run item replace entity @s armor.head with carved_pumpkin{Enchantments:[{id:"binding_curse",lvl:1}],HideFlags:63,display:{Name:"\"\""}}
execute if score oLifetime Stats matches ..2 as @s[scores={Temp=0..33}] run item replace entity @s armor.head with carved_pumpkin{Enchantments:[{id:"binding_curse",lvl:1}],HideFlags:63,display:{Name:"\"\""}}



xp set @s[scores={Temp=0}] 0
xp set @s[scores={Temp=1}] 7
xp set @s[scores={Temp=2}] 15
xp set @s[scores={Temp=3}] 22
xp set @s[scores={Temp=4}] 30
xp set @s[scores={Temp=5}] 37
xp set @s[scores={Temp=6}] 44
xp set @s[scores={Temp=7}] 52
xp set @s[scores={Temp=8}] 59
xp set @s[scores={Temp=9}] 67
xp set @s[scores={Temp=10}] 74
xp set @s[scores={Temp=11}] 82
xp set @s[scores={Temp=12}] 89
xp set @s[scores={Temp=13}] 96
xp set @s[scores={Temp=14}] 104
xp set @s[scores={Temp=15}] 111
xp set @s[scores={Temp=16}] 119
xp set @s[scores={Temp=17}] 126
xp set @s[scores={Temp=18}] 133
xp set @s[scores={Temp=19}] 141
xp set @s[scores={Temp=20}] 148
xp set @s[scores={Temp=21}] 156
xp set @s[scores={Temp=22}] 163
xp set @s[scores={Temp=23}] 170
xp set @s[scores={Temp=24}] 178
xp set @s[scores={Temp=25}] 185
xp set @s[scores={Temp=26}] 193
xp set @s[scores={Temp=27}] 200
xp set @s[scores={Temp=28}] 207
xp set @s[scores={Temp=29}] 215
xp set @s[scores={Temp=30}] 222
xp set @s[scores={Temp=31}] 230
xp set @s[scores={Temp=32}] 237
xp set @s[scores={Temp=33}] 245
xp set @s[scores={Temp=34}] 252
xp set @s[scores={Temp=35}] 259
xp set @s[scores={Temp=36}] 267
xp set @s[scores={Temp=37}] 274
xp set @s[scores={Temp=38}] 282
xp set @s[scores={Temp=39}] 289
xp set @s[scores={Temp=40}] 296
xp set @s[scores={Temp=41}] 304
xp set @s[scores={Temp=42}] 311
xp set @s[scores={Temp=43}] 319
xp set @s[scores={Temp=44}] 326
xp set @s[scores={Temp=45}] 333
xp set @s[scores={Temp=46}] 341
xp set @s[scores={Temp=47}] 348
xp set @s[scores={Temp=48}] 356
xp set @s[scores={Temp=49}] 363
xp set @s[scores={Temp=50}] 371
xp set @s[scores={Temp=51}] 378
xp set @s[scores={Temp=52}] 385
xp set @s[scores={Temp=53}] 393
xp set @s[scores={Temp=54}] 400
xp set @s[scores={Temp=55}] 408
xp set @s[scores={Temp=56}] 415
xp set @s[scores={Temp=57}] 422
xp set @s[scores={Temp=58}] 430
xp set @s[scores={Temp=59}] 437
xp set @s[scores={Temp=60}] 445
xp set @s[scores={Temp=61}] 452
xp set @s[scores={Temp=62}] 459
xp set @s[scores={Temp=63}] 467
xp set @s[scores={Temp=64}] 474
xp set @s[scores={Temp=65}] 482
xp set @s[scores={Temp=66}] 489
xp set @s[scores={Temp=67}] 496
xp set @s[scores={Temp=68}] 504
xp set @s[scores={Temp=69}] 511
xp set @s[scores={Temp=70}] 519
xp set @s[scores={Temp=71}] 526
xp set @s[scores={Temp=72}] 534
xp set @s[scores={Temp=73}] 541
xp set @s[scores={Temp=74}] 548
xp set @s[scores={Temp=75}] 556
xp set @s[scores={Temp=76}] 563
xp set @s[scores={Temp=77}] 571
xp set @s[scores={Temp=78}] 578
xp set @s[scores={Temp=79}] 585
xp set @s[scores={Temp=80}] 593
xp set @s[scores={Temp=81}] 600
xp set @s[scores={Temp=82}] 608
xp set @s[scores={Temp=83}] 615
xp set @s[scores={Temp=84}] 622
xp set @s[scores={Temp=85}] 630
xp set @s[scores={Temp=86}] 637
xp set @s[scores={Temp=87}] 645
xp set @s[scores={Temp=88}] 652
xp set @s[scores={Temp=89}] 659
xp set @s[scores={Temp=90}] 667
xp set @s[scores={Temp=91}] 674
xp set @s[scores={Temp=92}] 682
xp set @s[scores={Temp=93}] 689
xp set @s[scores={Temp=94}] 697
xp set @s[scores={Temp=95}] 704
xp set @s[scores={Temp=96}] 711
xp set @s[scores={Temp=97}] 719
xp set @s[scores={Temp=98}] 726
xp set @s[scores={Temp=99}] 734
xp set @s[scores={Temp=100}] 741

xp set @s 0 levels