restPoint

public static Location restPoint(PetControl control, Location center, double radius)

A spot to rest within radius of center in the body's own medium: in its hover band when it flies, on standing ground when it walks or cannot move, in water when it swims, and on ground or else in water when it is amphibious. A swimmer resting in water stays at center's height, so one told to stay deep keeps its depth; otherwise its spot is 0.5 to 2 blocks under the surface. Null when nothing near center fits. A hover point in an unloaded chunk comes back at center's height, unchecked, as hoverPoint gives it; the others are null there.