#execute if entity @p[r=50] run function spawn_horse
#execute if entity @p[r=50] run function spawn_villager