detecting when a player is in a cave

I've spent a few hours now trying to find a good way to check if a player is in a cave, and no luck

my temporary solution is if the player is standing on either stone or deepslate, but that would also happen when they're not in a cave.

is there a way to detect if the player is in a cave? that wouldn't be if they're under any cover

Continue to help post