tag @s remove NotGrounded
execute if block ~ ~-0.25 ~ air run tag @s add NotGrounded
execute if block ~ ~-0.25 ~ tallgrass run tag @s add NotGrounded
execute if block ~ ~-0.25 ~ double_plant run tag @s add NotGrounded
# checks for air below entity

tp @s[tag=NotGrounded] ~ ~-0.25 ~
execute as @s[tag=NotGrounded] run function projectiles/scourge_projectile_surface
# if air is found tps lower and repeats

tag @s remove NotSurfaced
execute unless block ~ ~ ~ air unless block ~ ~ ~ tallgrass unless block ~ ~ ~ double_plant run tag @s add NotSurfaced
# checks if entity is inside a block

tp @s[tag=NotSurfaced] ~ ~0.25 ~
execute as @s[tag=NotSurfaced] run function projectiles/scourge_projectile_surface
# if in a block tps higher and repeats
# after surface is found loop ends