#teleport the marker down, and if the block below is still NON-SOLID, repeat until it isn't
execute at @s run tp @s ~ ~-1 ~
execute at @s run execute if block ~ ~-1 ~ #suhc:bloodboltpassthrough run execute unless block ~ ~-1 ~ water run function zzzzdonotuse:structures/stalagmite/teleportdown
execute at @s run execute unless block ~ ~-1 ~ #suhc:bloodboltpassthrough run tag @s add DoScoreboard
execute at @s run execute if block ~ ~-1 ~ water run tag @s add DoScoreboard


#after it is done teleporting down, store the Y coord as a scoreboard. If the scoreboard is lower than the scoreboard of the MAIN MARKER's scoreboard, set the MAIN MARKER's scoreboard to the lower value
execute as @s[tag=DoScoreboard] run execute store result score @s KyuDummy run data get entity @s Pos[1] 1
execute as @s[tag=DoScoreboard] run scoreboard players operation @e[type=marker,sort=nearest,limit=1,tag=PyramidMarkerSpawnMain] KyuDummy < @s KyuDummy
kill @s[tag=DoScoreboard]