#randomizer between 1 and 20
scoreboard players set @a math_input1 1
scoreboard players set @a math_input2 15

#randomize call
execute as @a[scores={death=1..}] run function parkour_pyramid:services/random

#determine cause of death
execute as @a[scores={death=1..}] run function parkour_pyramid:deathmessages/setdeathcause

#act on cause of death with proper function call
execute as @a[scores={death=1..,deathCause=0}] run function parkour_pyramid:deathmessages/fall
execute as @a[scores={death=1..,deathCause=1}] run function parkour_pyramid:deathmessages/lava
execute as @a[scores={death=1..,deathCause=2}] run function parkour_pyramid:deathmessages/void
execute as @a[scores={death=1..,deathCause=3}] run function parkour_pyramid:deathmessages/tntminecart
execute as @a[scores={death=1..,deathCause=4}] run function parkour_pyramid:deathmessages/bounce
execute as @a[scores={death=1..,deathCause=5}] run function parkour_pyramid:deathmessages/outofmap
execute as @a[scores={death=1..,deathCause=6}] run function parkour_pyramid:deathmessages/minecart
execute as @a[scores={death=1..,deathCause=7}] run function parkour_pyramid:deathmessages/fangs
execute as @a[scores={death=1..,deathCause=8}] run function parkour_pyramid:deathmessages/risingwater
execute as @a[scores={death=1..,deathCause=9}] run function parkour_pyramid:deathmessages/witch
scoreboard players reset @a deathCause