


#summon mob system

(not neather) if player overground spawn air mob
(not neather) if player on ground, randomize if spawn air mob or ground mob
(overworld) if player underground, always ground mob

#spread armor_stand
(other) if ground mob, randomize the targeted hight (the under Y thing) and spread a armor_stand
(overworld) if air mob, spread armor_stand and teleport the mob up some blocks

#detect what mobs it can spawn
(overworld) if block below armor_stand is water tp it downwards and give water tag
(overworld) check if the block below armor_stand is a block mobs can spawn at and give ground tag
(other) randomize if spawn air or ground mob, if air teleport armor_stand up and give tag, if ground give tag
(nether) if block below is lava, give lava tag
if no tag was given leave as fail and retry to spawn a new mob

#summon random mob
summon a random mob depending on tag