##move up a few blocks until it finds air

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s[tag=MoveUp] run tp @s ~ ~1 ~
tag @s remove MoveUp

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s[tag=MoveUp] run tp @s ~ ~1 ~
tag @s remove MoveUp

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s[tag=MoveUp] run tp @s ~ ~1 ~
tag @s remove MoveUp

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s[tag=MoveUp] run tp @s ~ ~1 ~
tag @s remove MoveUp

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveUp
execute at @s[tag=MoveUp] run tp @s ~ ~1 ~
tag @s remove MoveUp

##if it hasn't found air yet, move back down to the start
execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveBackDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveBackDown
execute at @s[tag=MoveBackDown] run tp @s ~ ~-5 ~
#tag @s remove MoveBackDown




##same thing, but move down

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s[tag=MoveDown] run tp @s ~ ~-1 ~
tag @s remove MoveDown

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s[tag=MoveDown] run tp @s ~ ~-1 ~
tag @s remove MoveDown

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s[tag=MoveDown] run tp @s ~ ~-1 ~
tag @s remove MoveDown

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s[tag=MoveDown] run tp @s ~ ~-1 ~
tag @s remove MoveDown

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveDown
execute at @s[tag=MoveDown] run tp @s ~ ~-1 ~
tag @s remove MoveDown

execute at @s run execute unless block ~ ~ ~ #suhc:bloodboltpassthrough run tag @s add MoveBackUp
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add MoveBackUp
execute at @s[tag=MoveBackUp] run tp @s ~ ~5 ~
##spreadplayers if all else fails
execute at @s[tag=MoveBackUp] run spreadplayers ~ ~ 0 1 false @s
##spreadplayers regardless 25% of the time, for the heck of it because spawners on trees is funny
execute if predicate suhc:25percent run execute at @s[tag=!MoveBackUp] run spreadplayers ~ ~ 0 1 false @s

#tag @s remove MoveBackUp



##spreadplayers takes priority after the above commands run, but it's just in case the spreadplayers fails

execute at @s run setblock ~ ~ ~ spawner
tag @s add PlacedSpawner
#kill @s