mojira.dev
MC-152728

The player continues sprinting when performing actions that slow them down

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:

  1. Obtain a shield, begin blocking with it and walk forwards a couple of blocks.

  2. Take note of how fast you're traveling.

  3. Begin sprinting and then start blocking with the shield.

  4. Take note of how fast you're traveling now compared to the speed at which you were traveling before.

  5. 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.

Related issues

MC-153075 Sneaking when sprinting does not lower the FOV again MC-153150 Sprinting then sneaking is faster than walking then sneaking MC-153256 "sneak sprinting" MC-153765 Sprinting particles while shifting MC-153846 Running, then sneaking still creates particles MC-153866 Players are still able to run when either eating, blocking and using range weapons MC-153971 No Slowdown MC-154102 The effect of running is not removed when you crouch MC-154225 Sprinting particles don't stop when sneaking MC-154755 Sprinting particle while crouching MC-155131 Sprint and shift does not slow. This same with sprint and eat MC-155763 I can still run while i'm right clicking a bow, sneaking, crouching, right clicking a shield, right clicking a crossbow, right clicking a trident MC-156196 Player is able to do unintended actions while doing something else in which it should prohibit said action. MC-156351 Crouching after sprinting keeps sprint FOV and particles enabled MC-156994 Sprint particle bug MC-157677 Sprinting into sneaking particle bug MC-158305 you can sprint while sneaking MC-160588 crouching or crawling after running without stopping shows the block particles MC-164452 Particles shown while sneaking if you hold sprint key and sneak MC-167699 Crouch sprint bug MC-169301 Sprint-Sneaking MC-169681 grafical bug MC-171967 Running particles keep spawning MC-175098 Sprint particles are rendered while sneaking directly from a sprint MC-183369 Sneaking against walls MC-189659 if you press shift and ctrl at the same time it makes you sprint, if you shift, you are faster than a normal crouch, and crouching does not cancel the sprinting, if you uncrouch you will still be sprinting MC-193106 FOV not updating switching from running to crouching MC-202877 Sprint Crouching MC-205240 Sneaking while flying and sprinting in creative does not slow the player down MC-209381 Sprinting particles appear when shielding directly from sprint MC-213240 Sprint Shifting MC-215590 dynamic fov doesn't work correctly when crouching MC-227824 Fast while on stairs eating while sprinting MC-232344 Can Sprint Jump/ Head bang while sneaking MC-258903 Running before activating shield increases speed. MC-258976 Crouch statistic does not update if crouch was initiated whilst sprinting MC-259111 Sprinting and shield MC-264185 Sprinting while gliding MC-264458 Sprinting and then sneaking while sprinting keeps the sprinting fov MC-272246 Sprint sneaking MC-278830 Activating Elytra cancels sprinting MCL-10973 Sneaking while runing still shows the runing particles

Attachments

Comments

migrated
[media][media]
migrated

Able to reproduce. OS is Windows 10 Home.
Video

migrated

Affects 1.14.2-pre4

TheDoctorLink

Can confirm in 1.14.2-pre4 using Linux

migrated

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.

Nassim Jahnke

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"

migrated

You can reproduce this by preparing to throw a trident and preparing to charge a bow/crossbow.

migrated

Not sure what your point is KennyTV. I didn't say the title is inaccurate or anything. I simply asked for "FOV" to be added somewhere in the bug report so that it's easier to find.

Reason being is that this bug also affects the FOV (which is a symptom of sprinting, yes), and the FOV not changing correctly was first and only thing I noticed about this bug for a little while, leading me to create a duplicate bug report as I didn't find this one. I realized later that there was more to it than that. Had "FOV" been anywhere in the bug report I would have found it immediately and not wasted people's time. I don't see the harm in it being added.

Anyway, FOV has since been added to the labels, which is all I was really looking for.

gaspoweredpick

Confirmed. I added some extra information to the report that came from the comments to help this ticket become easier to search for.

migrated

Still in 1.14.3 pre2

JUE13

Can confirm for 19w35a

gaspoweredpick

This is now an even bigger problem as of 19w41a, as you can toggle sprinting and sneaking allowing you to sneak sprint just by pressing 2 buttons. Normal sneaking will become completely useless.

migrated

Happens in 19w42a

migrated

Also, I think that If you move diagonally (holding both w and a or d) you can move even faster

migrated

Still an issue in 1.15 Pre-Release 6

migrated

And 1.15 Pre-Release 7, but you might as well wait until 1.15 is released to update the ticket at this point... :/

Still affects 1.15

migrated

1.15.1. Fixing Craft but not fixed..

violine1101

What?

migrated

Prior to 1.15, sprint inputs can now be switched between hold and toggle mode in the Accessibility options.

migrated

Affects 1.15.2 pre-release 2.

migrated

Affects 20w06a

migrated

Affects 20w07a

migrated

Is this a feature? Still in 20w09a

migrated

No, it's a bug

migrated

30 versions of Minecraft released with this bug and still not fixed. (20 here in "versions:"). Is this so hard to repair??

migrated

I kind of prefer this bug to be kept.

Makes cheaters in PvP servers have 1 less advantage.

migrated

20w13a, 20w13b

migrated

I'd say it's a bug that's becoming a feature, like 0-ticking was, I don't really care if it gets removed or not, and that's why it hasn't been removed, it's a bug nobody cares much about.

migrated

Confirmed for 1.16 pre-release 2

Artimipa

Affects for 1.16 Pre-release 5

migrated

In one snapshot it was made that you no longer produce particles when walking. You used to also produce sprinting particles, like normal sprinting.
Edit: When blocking with a shield while sprinting you still produce particles, but not when sprinting and sneaking at the same time.

migrated

Can confirm for 1.16 pre release 7

migrated

Confirmed in 1.16 Pre-release 8.

numeritos

Affects 1.16-rc1

migrated

In 1.16.2-pre1

migrated

1.16.3-rc1

SunCat

The ownership of the ticket was given to @unknown due to original reporter being inactive

migrated

20w48a

Avoma

Can confirm in 21w03a. Willing to take ownership as the report has been marked as inactive.

Avoma

Can confirm in 21w08b.

migrated

Relates to MC-99848

migrated

21w18a

migrated

21w20a

gaspoweredpick

Using swift sneak, this allows you to sneak very quickly while jumping.

migrated

Also another thing to point out unless I'm mistaken. If you begin to sprint, then sneak, and then jump, you're then faster than walking speed, notably at swift sneak 3.

migrated

Can confirm that this bug is still present as of version release 1.19.1

https://youtu.be/pAfPrxxMksU

migrated

this bug has been in minecraft for way too long time, and i think they made ti a feature since i use it too and know how does it work. the only thing that stops the player from sprinting when doing the listed things is when you accidentaly push into a block then you cant retreive the sprint back while doing the listed things above

Avoma

I've removed the "riding entities" part from this ticket and reported this issue separately at MC-267343 since I believe this is a different problem.

J_Gamer_Xone

Could this "bug" be kindly unfixed? Sprint Sneaking is one of the best mechanics in the game and makes raiding Ancient Cities actually fun. Slowly sneaking around isn't fun, but stealthily dashing about with the Sprint Sneak while dodging sensors is a lot of fun. I literally get Swift Sneak specifically for use with Sprint Sneaking.

Also who honestly wants to reinput the sprint button every time they eat, I'm calling it now, people who never knew this was a "bug" are going to complain when they find out that eating now cancels their sprint.

My take is, if fixing a "bug" makes the game feel more sluggish and less fun, that is not a "bug" that you want to fix.

Avoma

Please leave feedback on the Minecraft feedback website instead of here on the bug tracker. This ticket was considered a valid issue, so it's unlikely that the fix will be reverted. After all, you cannot begin sprinting while using an item so it makes sense for sprinting to be canceled upon performing the said interactions.

SeaOfPixels

Reported the loss of sprint input buffer (a side-effect of this bug) as its own bug over at MC-278005.

Ceresjanin123

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 )

Jurta

Bug fix has been reverted. See 25w04a's announcement article.

TeyRine

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

Brevort

@Riflusso That is actually tracked under MC-279688

B4dAtMC

this bug isn't in 1.21.4 but it is in 25w04a

Avoma

(Unassigned)

Confirmed

Platform

Normal

Player

mojang_internal_1

Minecraft 1.14.2 Pre-Release 3, Minecraft 1.14.2, Minecraft 1.14.3 Pre-Release 1, Minecraft 1.14.3 Pre-Release 2, 1.14.4, ..., 1.21 Release Candidate 1, 1.21.3, 25w04a, 25w08a, 1.21.5

24w44a

Retrieved