PetMotion
Movement maths shared by the pet behaviors: hover, standing and swimming spots, the ground under a point, and one tick of steering. A floating body steers by velocity, since a flying mob's navigation crawls; a walking or swimming body paths there natively. Speeds are blocks per tick.
Functions
Link copied to clipboard
Whether the species hovers over liquid surfaces: everything that does not swim.
Link copied to clipboard
The top of the highest solid block under the point, searched a bounded number of blocks down.
Link copied to clipboard
A spot to stand on within radius of center: the floor of a random column nearest center's height.
Link copied to clipboard
A point near center, inside the species' hover band above the ground under it.
Link copied to clipboard
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.
Link copied to clipboard
Free to wander: not told to stay, and wild or within the follow distance of its owner.
Link copied to clipboard
One tick of flight toward target: accelerate to the cruise speed, ease off over the last few blocks, and hold still on arrival.
Link copied to clipboard
Puts the body beside its owner: in its hover band when floating, on standing ground when walking, in water when swimming, and on ground or else in water when amphibious, so it keeps up with an owner who swims or sails.
Link copied to clipboard
Behind the owner: back blocks behind where they face, height above their feet when floating, at them otherwise.
Link copied to clipboard
A spot in water within radius of center, between minDepth and maxDepth below the topmost water the column's scan finds.