The Bug:
Sprinting isn't canceled upon receiving the blindness effect.
The player cannot begin sprinting while having the blindness effect, but their sprinting state isn't canceled when initially receiving the blindess effect.
Steps to Reproduce:
Summon a command block that will give you the blindness effect along with a pressure plate to activate it by using the commands provided below.
/setblock ~2 ~-1 ~ minecraft:command_block{Command:"effect give @p minecraft:blindness"}
/setblock ~2 ~ ~ minecraft:oak_pressure_plate
Begin sprinting and activate the command block by running on top of the pressure plate.
Observe the speed at which you are moving once you are given the blindness effect.
Observed Behavior:
Sprinting isn't canceled.
Expected Behavior:
Sprinting would be canceled.
Code Analysis:
Code analysis by @unknown can be found in this comment.
Related issues
is duplicated by
relates to
Attachments
Comments


Confirmed for 1.13.1, please link this comment in the description
The reason for this happening is because it does not set the players sprinting to false when receiving blindness / there are no checks for it.
This could be easily fixed by adding a check in method onLivingUpdate. so if blindness is active and the player is sprinting it would set sprinting to false.
[media]
Confirmed 1.12 and 1.12.2

Still the case in 1.14.3.

Confirmed in 1.16.1 and 20w27a.
Can confirm in 20w48a. To reproduce, I used this simple setup. The command inside of the command block is:
/effect give @p minecraft:blindness
[media]Can confirm in 21w03a.
Can confirm in 21w05b.
Can confirm in 21w06a.
Video attached.

Requesting ownership as the current reporter has been inactive since 2018
Can confirm in 21w07a.

Relates to MC-152728
Can confirm in 21w11a.
Can confirm in 1.17.
Can confirm in 1.17.1.
Can confirm in 1.18.2 and 22w16b.