mojira.dev
MC-313300

Pigs and striders regain their speed boosts after reloading the world

The Bug:

Pigs and striders regain their speed boosts after reloading the world.

Since MC-313141 was fixed, the speed boost from a carrot on a stick or a warped fungus on a stick is saved when the world is reloaded. However, when a pig or a strider whose boost has already ended is ridden again after reloading the world, it speeds up as if the item had just been used.

Steps to Reproduce:

  1. Open the debug options menu and set the player_speed option to “Always”.

  2. Summon a pig that’s equipped with a saddle by using the command provided below.

    /summon minecraft:pig ~ ~ ~ {equipment:{saddle:{count:1,id:"minecraft:saddle"}}}
  3. Obtain a carrot on a stick, begin riding the pig, and use the carrot on a stick.

  4. Keep riding the pig and take note of how fast you’re moving.

  5. Wait for the speed boost to end and then leave and rejoin the world.

  6. Take note of how fast the pig is now travelling.

Observed Behavior:

The mob speeds up as if the carrot on a stick was used again.

Expected Behavior:

The mob would keep its normal speed until the carrot on a stick is used again.

Linked issues

Comments 2

The new behavior is fundamentally broken and flawed. It would be expected that item_based_steering would contain only boost_time (consider renaming to boost_time_elapsed for clarity) and boost_time_total, and both of these values would be set to 0 (or -1) when a boost wears off, and the former would continue counting when the player switches to another item. But presently there is an unnecessary boosting boolean, and it seems that reloading a pig with boosting:1b will start a new boost based on its boost_time_total, meaning the stored boost_time is useless; additionally, boost_time and boost_time_total do not reset when a boost finishes, and switching to another item causes boost_time to stop incrementing. If desired, I can make additional reports to track these bugs when I have time.

Avoma

bl4ckscor3

Confirmed

Platform EC

Normal

Mob behaviour, Save Data

26.4 Snapshot 10

26.4 Pre-Release 2

Retrieved