This report describes several closely related issues which I’m including in a single report because of the nature of the fix that would be needed.
Description
Pigs and striders store too much data relating to their speed boost, and the data is still not interpreted correctly. 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 dismounts or switches to another item (because the pig is still digesting the carrot). 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. Meanwhile, boost_time, formerly useless due to MC-313300, now continues to increment, but the pig’s speed ramps up again from its normal movement speed before reverting to normal abruptly when the boost wears off. Furthermore, although boost_time_total now resets when a boost finishes, boost_time increases by 2 and does not reset.and boost_time_total do not reset when a boost finishes.
To reproduce
I’m not taking any chances this time. The steps below show how to reproduce the issues described above with a dedicated setup. The attached video shows steps 11-18.
Find a flat surface with no other pigs nearby
/scoreboard objectives add values dummy/scoreboard objectives setdisplay sidebar values/gamerule command_block_output falsePlace and power a repeating command block, facing up, with
execute store result score boosting values run data get entity @n[type=pig] item_based_steering.boostingAbove it, place an always-active chain command block, also facing up, with
execute store result score boost_time values run data get entity @n[type=pig] item_based_steering.boost_timeAbove that, place another always-active chain command block, also facing up, with
execute store result score boost_time_total values run data get entity @n[type=pig] item_based_steering.boost_time_totalGive yourself a carrot on a stick
Ensure your player speed is visible in the debug overlay
/summon minecraft:pig ~ ~ ~ {equipment:{saddle:{count:1,id:"minecraft:saddle"}}}Mount the pig, without activating the carrot on a stick, and take stock of things
❌ Three fields are stored on the pig, even though only two are ever needed to determine the pig’s speed;boostingis unnecessaryRight-click with the carrot on a stick
✔ Things seem to be working just fineAllow the boost to complete, holding the carrot on a stick the whole time
✔boost_time_totalresets to 0
❌boost_timeends up at the oldboost_time_total+ 2Boost the pig again
About halfway through the boost, reload the world
❌ The pig is slowly ramping up speed again, as if from a new boostWait for the boost to end
❌ The pig’s speed boost expires abruptlyStart a third boost
Halfway through, switch to a different item or dismount
❌boost_timestops incrementing even though the pig should still be digesting the carrot