execute store result score %_mob dungeon run data get entity @s data.spawn_percentage
function rng:percentage


# Dificulty percentage add
scoreboard players set #tmp dungeon 10
execute store result score #difficulty dungeon run difficulty

execute if score #difficulty dungeon matches 1 if score %_mob dungeon > #tmp dungeon unless score %_mob dungeon matches 100 run scoreboard players remove %_mob dungeon 5
execute if score #difficulty dungeon matches 1 if score %_mob dungeon > #tmp dungeon unless score %_mob dungeon matches 100 run scoreboard players remove %_mob dungeon 5

execute if score #difficulty dungeon matches 3 run scoreboard players add %_mob dungeon 10


# Multiplayer percentage add -> max add 25 %, remove 5 since single player doesn't affect
scoreboard players remove %_mob dungeon 5
execute as @a[limit=6] run scoreboard players add %_mob dungeon 5


# Choose
execute if score %_mob dungeon < out rng run kill @s
