
# -> If player is in water then return and do drowning damage
execute anchored eyes \
    positioned ^ ^ ^ \
    anchored feet \
    if block ~ ~0.1 ~ water run \
        return run \
            damage @s 2 drown

# -> Else do generic damage
damage @s 2 generic