How to get world surface y-level in a scoreboard

Hi there! I've been trying to get the world's motion blocking surface y-level in a scoreboard. I know I can use data get entity ... Pos[1] to get an entity's y-coordinate, but then using execute positioned over motion_blocking store result score ... data get entity ..., obviously also doesn't work since changing where the command is being run from does not change the entity's NBT.

There probably is a way to do this but my brain just isn't working right now q-q

Continue to help post