I am trying to make a system where you get a potion effect when you're in sunlight, the way i was going to do this was to execute as the player to test if there is a block of air above them. Here's what i've tried so far
execute @p ~ ~ ~ testforblock ~ ~2 ~ air
However this only tests of there is a block of air DIRECTLY above the player, and not if they're covered. So if the player was in a cave with a high ceiling, they would still be considered to be in sunlight, which is not what i want.
I am trying to make a system where you get a potion effect when you're in sunlight, the way i was going to do this was to execute as the player to test if there is a block of air above them. Here's what i've tried so far
However this only tests of there is a block of air DIRECTLY above the player, and not if they're covered. So if the player was in a cave with a high ceiling, they would still be considered to be in sunlight, which is not what i want.
Anyone have suggestions?