mojira.dev
MC-278753

"Sprinting" mobs stop sprinting upon reloading the world

Various mobs which can "sprint" (move faster than their idle walking speed) will cease doing so when the world is reloaded. This affects:

  • Villagers and animals fleeing from danger

  • Creepers fleeing from cats

  • Pigs and striders which have been "speed-boosted" by their riders

  • Various situations covered by MC-250059, if we consider mobs like pillagers, iron golems, etc. to "walk" when idle and "sprint" when pursuing a target, which makes sense to me

This happens because mobs' sprinting state is not saved to NBT.

How to reproduce

  1. Punch a cow

  2. Immediately reload the world
    ❌ Notice how the cow is no longer fleeing from you. (It also forgot where it was walking to due to MC-183791.)

Suggested fix

I suggest fixing this as part of a refactor that also fixes MC-183791 and MC-250059. Extra speed from sprinting would be stored as a modifier to the minecraft:movement_speed attribute (as would player sprinting/crouching/crawling), and the base Mob class would gain 3 new fields: danger_source (int array; UUID) attack_target (int array; UUID) and path_target (int array; block pos). Whenever a mob re-evaluates its movement, it checks these fields in the order listed here to determine what to do. Pigs and striders would also gain boost_time_remaining and boost_time_total fields so that their boost state is preserved.

I realize that this section kind of reads like a design suggestion but I feel like I would be remiss not to propose a comprehensive solution. As far as I know Mojang aspires for gameplay to be completely unaffected by world reloads – with very limited exceptions – so these internal changes seem to me like the natural extension of that logic.

Linked issues

Comments 4

Thank you for your report!
After consideration, the issue is being closed as Invalid.

You have posted a feature request or a suggestion. This site is for bug reports only.
For suggestions, please visit The official Minecraft feedback site or visit the Minecraft Feedback Discord server.

Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support (Technical Issues) – 📧 Microsoft Support (Account Issues)
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki

How is this a feature request when all the other reports about data being lost on reload are valid? And in particular, why is MC-183791 valid while this isn't? Why is it intended that a cow forgot that you punched it but unintended that it forgot which block it was walking/running to?

Like you said, this report reads like a design suggestion; the issue/result of this problem in question is only a small part of the report.

BTW fixing the danger fleeing also requires saving that timer, or it just resets on reload,making them either stop fleeing immediately, or restart fleeing if it was about to stop before.

clamlol

(Unassigned)

Community Consensus

Save Data

1.21.4

Retrieved