mojira.dev
MC-99848

Sprinting isn't canceled upon receiving the blindness effect

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:

  1. 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
  1. Begin sprinting and activate the command block by running on top of the pressure plate.

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

Linked issues

Attachments

Comments 16

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

Daniel Chýlek

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]
6 more comments

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.

Geotan

Avoma

rkullenius

Confirmed

Gameplay

Low

Player

blindness

Minecraft 1.9, Minecraft 1.9.1 Pre-Release 3, Minecraft 1.10.2, Minecraft 16w32b, Minecraft 16w33a, ..., 1.20.6, 1.21, 1.21.1, 1.21.2 Pre-Release 3, 1.21.3

24w45a

Retrieved