How can you track players in Minecraft, which block they are on (using commands)?

Ob
2

I need that for my minigame project.

Be

/ execute at @a if block ~ ~ -1 ~ minecraft: stone run say yes

Ob

Thank you so much!