mojira.dev
MC-300859

The center of the blocks the copper golem is standing on is not compared with the center of the chests

Background:

The center of the block a golem is standing is what is used in the function BlockPos.distToCenterSqr in the TransportItemsBetweenContainers.getTargetBlockPosition to compare against (blockPos.getX(), blockPos.getY(), blockPos.getZ()), however (blockPos.getX(), blockPos.getY() and blockPos.getZ()) is not the center of the block but rather the edge. This leads to unexpected, directional behaviour of copper golems. The correct snippet would be:

.min(Comparator.comparing(transportItemTarget -> transportItemTarget.pos.distToCenterSqr(blockPos.getX() + 0.5, blockPos.getY() + 0.5, blockPos.getZ() + 0.5)));

Reproduce:

spawn a golem into the structure block file that I shared here. Then, rotate the structure by 180 degree and repeat.

What happens:
The golem doesn’t pick the chest right below it, but rather the one after.

Expected result:
the golem picks the closest chest

Attachments

Comments 2

I forget to mention what happens after the rotation: everything works as expected, namely the copper golem chooses to open the closest chest.

We do not have enough information to find the cause of this issue.

Please record a video of this happening and attach it to this report.
If you are on Windows, you can use Windows+Alt+R to open a built-in app for recording game footage.
If you are on Mac (Mojave or later), you can use Shift+Command+5 to open a built-in app for recording your screen.
In case you don't have a program to record videos, we recommend using the free recording software OBS.
In case the resulting video file is too large to be uploaded to the bug tracker directly, please upload it elsewhere (e.g. as unlisted video on YouTube) and link to it here.

This issue is being temporarily resolved as Awaiting Response. Once the requested information has been delivered, the report will be reopened automatically.
Quick Links:
πŸ““ Bug Tracker Guidelines -- πŸ’¬ Community Support -- πŸ“§ Mojang Support (Technical Issues) -- πŸ“§ Microsoft Support (Account Issues) -- πŸ““ Project Summary -- ✍️ Feedback and Suggestions -- πŸ“– Game Wiki

GuiTaek

(Unassigned)

1475014

Confirmed

Expansion A

Mob behaviour

25w32a

Retrieved