Affects: cod, salmon, tropical fish, pufferfish, tadpoles, dolphins
Does not affect: guardians, turtles, frogs, drowned
The affected mobs react to any non-water block 1 block above their position as if they are colliding with it. This causes several pathfinding problems.
Steps to reproduce
Load the attached test world. [mediaInline] It contains a test chamber with a small water gap between two sides with deep water. Buttons spawn vanilla and custom fish and kill them, and levers toggle the blocks below the gap between stone and water.
Press the button to spawn a cod or tropical fish on the left side of the tank.
Watch the fish until it moves through the narrow gap to the right side.
Continue watching the fish until it tries to move from the lower half of the right side through the narrow gap to the left side.
Repeat steps (2) - (4) with the “random fish”, which is a custom mob with 0.5x0.5 collision that has the same navigation and random_swim components as the vanilla cod. It appears as a green cube.
Expected results
All fish move smoothly through the gap in both directions.
Observed results
When the vanilla fish move from the left side to the right they jolt downward after going into the gap under the center wall. When the vanilla fish attempt to move from the lower right side to the left side, they get stuck at the gap trying to move into the edge of the stone. The custom “random fish” does not have these problems.
Related issues
causes
Attachments
Comments

Hi!
Can you please record a video of this issue?
Alternate repro: spawn any of the affected mobs in the top water block of column of water blocks. It will immediately move downward because it detects a “collision” with whatever is above the top water block.
This behavior may be intended to prevent aquatic mobs from exposing themselves to air. However, it would be more intiutive to use the mob’s actual collision box for the “collision” instead of checking a full block height above their position.