mojira.dev
MC-304607

Copper golems sometimes fail to walk from a chest onto a diagonal fence or wall

When a copper golem standing on a chest attempts to walk onto a fence or wall diagonal to (and at the same elevation as) the chest, depending on where on the chest it was and the direction it is ultimately heading, it may fall off the chest. This can result it in it getting stuck in a loop. The attached video shows a couple of situations where this occurs. (Public viewers will need to use the logged-out view to see the video due to META-212.)

This issue is a manifestation of imperfections in the pathfinding system, and similar issues can arise with e.g. zombies and creepers pathing towards their target under certain situations, especially if their scale, movement speed and jump height are modified from their default values. In ordinary gameplay, however, the specific issue described above is the most noticeable, and a dedicated fix for it should be pursued. The solution is as follows: Let N be the width of the copper golem (default 0.49) divided by 2. When the copper golem is creating its path, if the path leads from the top of a chest onto a fence or wall diagonally, the copper golem pathfinds to one of the following 4 XZ coordinates in the chest’s block space, depending on which one is closest to the fence or wall:

  • N, N

  • 1-N, N

  • N, 1-N,

  • 1-N, 1-N

This will cause the copper golem to align itself with the diagonal before attempting to walk along it, thereby ensuring that it will always succeed in surmounting the fence or wall.

Linked issues

Attachments

Comments 2

clamlol

(Unassigned)

Community Consensus

(Unassigned)

1.21.10, 1.21.11 Pre-Release 3

Retrieved