Some larger entities which are either nearly a block big, or larger than a block behave erratically and incorrectly when trying to pathfind into water at foot level under some circumstances.
Steps to Reproduce:
Place down a single water source in the ground
Spawn a cow
Light it on fire
Observed Behavior:
The cow will pathfind to the water as expected, but will spin around on top of the water, never falling into it. It will stay lit on fire, and possibly die because of this.
Expected Behavior:
The cow would pathfind to the water, and fall in as it intends to.
Screenshots/Videos:
[media]
Notes:
Related to MC-228464 MC-223922 MC-200924 MC-165952 MC-248099
Linked issues
relates to 1
Attachments
Comments 3
Yeah, this is a common bug, and probably falls under the "Won't Fix" category. Because these mobs' hitboxes are rather large, when trying to get into a 1 block wide puddle of water, they will continuously hit the sides and auto-jump back up to dry land. In their frenzied state, it is impossible for them to slow down, and they therefore die.
For the sake of transparency, I would like to leave the original description of this issue in a comment here. This was the description used when the issue was triaged:
{color:#0000ff}There're two kinds of mobs whose "hitboxes are bigger than 1*1 block":{color}
1) Mobs which are +bigger than 1*1 block seen from any direction+, like polar bears. For further explanation, these mobs can't be spawned inside a narrow stream which has a 1-block width. When trying to do so, they'll be automatically spawned above water. *Now, the problems occurs: {color:#ff0000}when they run onto a narrow stream, they act like they're already in water, so they freeze there and don't take any further action.{color}* But they're still out of water, burning.
2) Mobs whose +lengths are longer than 1 block, but widths are shorter than 1 block+, like cows. These mobs can be spawned inside the narrow stream, but when in it, parts of their hitboxes sometimes can be inside the solid blocks on both sides of the stream, when they rotate to a specific range of angles. *They also have problems: {color:#ff0000}When burning, these mobs rotate rapidly when run onto a narrow stream of water.{color}*
----
*HOW TO REPRODUCE: (TAKE A COW AS AN EXAMPLE)*
Make a terrian and spawn a cow like Screenshot 1.
Before the cow moves into other places, put the cow on fire using flint and steel.
Notice how the cow will rotate rapidly above the narrow stream instead of going into the larger pond like Screenshot 2 & 3.
----
*SUGGESTIONS OF HOW TO FIX:*
1) {color:#0000ff}For a first kind of mob{color}, the best way to fix is to let it detect if the nearest water block is 1 block wide, or, in other words, if it cannot sink into that water block. If it indeed cannot, then it doesn't reach for that block, instead it directly reaches for the larger pond. *If coding that in is difficult*, then the mob can simply reach for the nearest water block and try to sink into it. If it cannot, then it reaches for the larger pond. +If there isn't a larger pond+, which means the mob cannot sink into water using any methods, then let the mob do the same as in the current release.
2) {color:#0000ff}For a second kind of mob{color}, it can sink into the narrow stream if it rotates to a certain angle, but it cannot sink into a single 1*1 block of water.
{color:green}If it's a narrow stream{color}, it doesn't need to rotate round and round and not sink into water. When it rotates to an angle it can sink in, simply let it sink in. *If coding that in is difficult*, then let the mob do the same as the first kind of mobs: either directly reaches for the larger pond, or reaches for the narrow stream, finds out its hitbox is bigger than 1*1, and reaches for the larger pond.
+If there isn't a larger pond+, then either let it rotate to a certain angle and sink in, or just let the mob do the same as in the current release, if the first choice to hard to code in, because there's no better way to let the mob sink in.
{color:green}If it's a single 1*1 block of water{color}, then it cannot sink in it. Let it do the same as the suggest way for the first kind of mobs.
----
*NOTE:*
If you don't understand some of my words, such as the "narrow stream", simply refer to the screenshots.
I can confirm this issue in the latest version, 24w11a. Considering this issue has not had proper upkeep in 4 years, I would like to request ownership of it. Primarily, to remove any unnecessary bloat from the description, and better clarify the issue here.