mojira.dev
MC-198840

Entities do pathfinding on the main Thread

Currently all the entities do all their pathfinding on the main thread which causes significant issues. Pathfinding can easily be multi-threaded using a chunkcache without causing any issues.

(As an example below our own async pathfinding implementation
https://github.com/ldtteam/minecolonies/tree/version/1.15/src/main/java/com/minecolonies/coremod/entity/pathfinding).

Examples: Villager entities use pathfinding EVERY single tick to find POI like their block to work on. Around 10 villagers doing that can cause significant lag spikes already.

This information is not required to be there at right this moment and does not have to be searched every single tick.

This is also a problem for zombies, skeletons etc, that try to find a path every tick instead of doing it a) Async and b) Less often.

We do have hostile entities in the mod linked above that are significantly more smarter than vanilla mobs and players can't notice any difference in terms of pathing reaction compared to the vanilla mobs but they do ALL their pathfinding on the off-thread and don't invoke it every tick.

Comments 4

This issue is invalid. Your game is modified.

This issue is valid, I am showing a way on how we solve this issue in a modded environment such that this could be adjusted in vanilla too.

Thank you for your report!
However, this issue is Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit Minecraft Suggestions on Reddit or visit the Feedback website.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

No no, you misunderstood. This is not a feature request. Villagers and other entities pathing on the mainthread causes unbearable lag spikes in the game on a multiplayer server (1-2 villagers trying to get to a distant place could already be enough) -> this is a bug, this shouldn't happen.

Ray Neiheiser

(Unassigned)

Unconfirmed

(Unassigned)

1.16.2

Retrieved