Easy to do. Problem is that you can't judge exactly when the player is in water, only if he's out deep - it's difficult / inaccurate on the shores.
However, I remember seeing a water detection method that involved a boat, but it wasn't visible, and it was totally accurate, too. It was in one of Vektorboson's threads on the BIS forums.