summon marker ~ ~ ~ {Tags:["StalagSpawn"]}

#generate random number(based on the above marker's UUID) between 0-21 to determine the mob spawn
execute as @s run execute store result score @s KyuDummy run data get entity @e[type=marker,distance=..1,sort=nearest,tag=StalagSpawn,limit=1] UUID[0] .1
scoreboard players set @s KyuDummy2 22
scoreboard players operation @s KyuDummy %= @s KyuDummy2

execute at @s[scores={KyuDummy=0..4}] run summon wither_skeleton ~ ~ ~ {HandItems:[{id:"minecraft:stone_axe",Count:1b},{}],ArmorItems:[{id:"minecraft:chainmail_boots",Count:1b},{id:"minecraft:chainmail_leggings",Count:1b},{id:"minecraft:chainmail_chestplate",Count:1b},{id:"minecraft:leather_helmet",Count:1b}],ArmorDropChances:[0.025F,0.025F,0.025F,0.025F]}
execute at @s[scores={KyuDummy=5..6}] run summon cave_spider ~ ~ ~ {Attributes:[{Name:generic.armor,Base:5}]}
execute at @s[scores={KyuDummy=7..11}] run summon zombie ~ ~ ~ {HandItems:[{id:"minecraft:stone_axe",Count:1b},{}],ArmorItems:[{id:"minecraft:chainmail_boots",Count:1b},{id:"minecraft:chainmail_leggings",Count:1b},{id:"minecraft:chainmail_chestplate",Count:1b},{id:"minecraft:leather_helmet",Count:1b}],ArmorDropChances:[0.025F,0.025F,0.025F,0.025F]}
execute at @s[scores={KyuDummy=12..16}] run summon skeleton ~ ~ ~ {HandItems:[{id:"minecraft:bow",Count:1b,tag:{Enchantments:[{id:"minecraft:power",lvl:1s}]}},{}],ArmorItems:[{id:'minecraft:chainmail_boots',Count:1b},{id:'minecraft:chainmail_leggings',Count:1b},{id:'minecraft:chainmail_chestplate',Count:1b},{id:'minecraft:leather_helmet',Count:1b}],ArmorDropChances:[0.025F,0.025F,0.025F,0.025F]}
execute at @s[scores={KyuDummy=17..21}] run summon spider ~ ~ ~ {Attributes:[{Name:generic.armor,Base:5}]}



summon marker ~ ~ ~ {Tags:["StalagSpawn2"]}
summon marker ~ ~ ~ {Tags:["StalagSpawn2"]}
summon marker ~ ~ ~ {Tags:["StalagSpawn2"]}
summon marker ~ ~ ~ {Tags:["StalagSpawn2"]}
summon marker ~ ~ ~ {Tags:["StalagSpawn2"]}

execute at @s run execute as @e[type=marker,distance=..1,tag=StalagSpawn2] run function zzzzdonotuse:3sec/spawnerstuff/stalagmitespreadcoord


