The Bug:
The player continues sprinting when performing actions that slow them down.
There are certain actions that slow down the player's movement speed. When one of these actions is commenced while the player is sprinting, the player doesn't stop sprinting, and as a result of this, these actions don't slow the player down as much as if they weren't sprinting. The player is unable to start sprinting while one of these actions is active, and as such, this is not intentional.
Actions that slow down the player include:
Sneaking
Crawling
Eating or drinking
Using a spyglass
Blocking with a shield
Charging a bow or crossbow
Preparing to throw a trident
Using a goat horn
Flying with elytra
Steps to Reproduce:
Obtain a shield, begin blocking with it and walk forwards a couple of blocks.
Take note of how fast you're traveling.
Begin sprinting and then start blocking with the shield.
Take note of how fast you're traveling now compared to the speed at which you were traveling before.
Take note as to whether or not the player continues sprinting when performing actions that slow them down
Observed Behavior:
The player continues to sprint. Although the player is slowed down, they are not slowed down to the speed they would be traveling if they were not sprinting.
Expected Behavior:
The player would stop sprinting and when using items, they would slow down to the same speed regardless of whether or not they were sprinting.
Code Analysis:
Code analysis by @unknown can be found below.
The following is based on a decompiled version of Minecraft 1.18.1 using MCP-Reborn.
net.minecraft.client.player.LocalPlayer.java
public class LocalPlayer extends AbstractClientPlayer {
...
public void aiStep() {
...
if (this.isUsingItem() && !this.isPassenger()) {
this.input.leftImpulse *= 0.2F;
this.input.forwardImpulse *= 0.2F;
this.sprintTriggerTime = 0;
}
...
If we look at the above class, we can see that when a player starts using an item, their movement speed is decreased by a fixed amount. This is evident through the following lines of code:
this.input.leftImpulse *= 0.2F;
this.input.forwardImpulse *= 0.2F;
However, this piece of code doesn't check if the player was sprinting when beginning to use an item, thus resulting in players continuing to sprint (and not being completely slowed down) when using items.
Linked issues
is duplicated by 42
relates to 4
Attachments
Comments 55
Still in 1.14.2 (Release). Also, please add "FOV" be added to the title/description to make it easier to find this bug report.
The fov has nothing to do with the sprinting, it's just its symptom. The title is perfectly fine as "you sprint, you start sneaking, but don't actually stop sprinting"
For those interested here's a feedback post if you wish to discuss this. As the bug tracker is not the right place.
(If you can't log in look at pinned comment in WEB-6665 )
Bug fix has been reverted. See 25w04a's announcement article.
Bug hasn't reverted consistently. Flying with elytra not work as intended. It works like in versions with fixed bug
Wrote bug report about this problem https://bugs.mojang.com/browse/MC-279725
@Riflusso That is actually tracked under MC-279688
Able to reproduce. OS is Windows 10 Home.
Video