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.

Related issues

Attachments

Comments

migrated
[media][media][media]
migrated

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]
migrated

Confirmed 1.12 and 1.12.2

migrated

Still the case in 1.14.3.

j_p_smith

Confirmed in 1.16.1 and 20w27a.

Avoma

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]
Avoma

Can confirm in 21w03a.

Avoma

Can confirm in 21w05b.

Avoma

Can confirm in 21w06a.

Avoma

Video attached.

Mask3D_WOLF

Requesting ownership as the current reporter has been inactive since 2018

Avoma

Can confirm in 21w07a.

migrated

Relates to MC-152728

Avoma

Can confirm in 21w11a.

Avoma

Can confirm in 1.17.

Avoma

Can confirm in 1.17.1.

Avoma

Can confirm in 1.18.2 and 22w16b.

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