Sprint scoreboards won't increase after sprint-attacking (with the sprint key held down)
Created Issue:
Sprint scoreboards wont increase after Sprint-Attacking (with Sprint held down)
I'm trying to make something like Pig Simulator in vanilla Minecraft, because this was done WITH mods, but my version doesn't. Anyway, if you sprint attack an entity and hold down your sprint key (for me, it's SHIFT), you will continue to sprint, but the scoreboard will not increase.
Environment
Windows 7, Latest Java x64
I'm trying to make something like Pig Simulator in vanilla Minecraft, because this was done WITH mods, but my version doesn't. Anyway, if you sprint attack an entity and hold down your sprint key (for me, it's SHIFT), you will continue to sprint, but the scoreboard will not increase. It's only when you resprint that it will start increasing again.
is duplicated by
relates to
I'm trying to make something like Pig Simulator in vanilla Minecraft, because this was done WITH mods, but my version doesn't. Anyway, if you sprint attack an entity and hold down your sprint key (for me, it's SHIFT), you will continue to sprint, but the scoreboard will not increase. It's only when you resprint that it will start increasing again.
Windows 7, Latest Java x64
Sprint scoreboards wont increase afterSprint-Attacking (withSprint held down)Sprint scoreboards won't increase after sprint-attacking (with the sprint key held down)
duplicates
is duplicated by
Description
The minecraft.custom:minecraft.sprint_one_cm randomly fails to increase some ticks while sprinting.
Expected Behavior
When sprinting at a constant speed across flat terrain, the minecraft.custom:minecraft.sprint_one_cm scoreboard objectives should increase constantly each tick.
Actual Behavior
The objectives randomly fail to increase on some ticks, at seemingly inconsistent times.
Possible Relationship
Possibly related to MC-56229, though it occurs even if you don't attack. It occurs even if you do nothing except hold down sprint and forward, in fact.
Reproduction Setup
Create a world. Add an objective called Sprinting of type minecraft.custom:minecraft.sprint_one_cm, and an objective called RunTime of type dummy. Then set up three command blocks which run this chain every tick:
execute as @a[scores={RunTime=1..}] if score @s Sprinting <= @s RunTime run tellraw @s ["Sprinting: ",{"score":{"name":"@s","objective":"Sprinting"}}," | RunTime: ",{"score":{"name":"@s","objective":"RunTime"}}]
execute as @a if score @s Sprinting <= @s RunTime run scoreboard players set @s Sprinting 0
execute as @a run scoreboard players operation @s RunTime = @s Sprinting
Now sprint. You'd expect to only get any tellraw output when you stop sprinting, but in fact you get the output at random values of Sprinting, and it resets at those random times, because it hasn't increased since the last tick even though you're sprinting at a constant speed. (See attached screenshot for some example output.)
Another way to test is to simply tellraw to players with a Sprinting score of 0 and then reset the score to 0 after, then sprint; you expect no output while sprinting as it should always be set to at least 1 each tick while sprinting, but you'll occasionally still get output anyway as it fails to increase from 0. That's just harder to see when the output is all the same and constantly flowing, though.
Confirmed. I suspect this is because attacking ends your sprint when not holding down the sprint key.
15w43a
Confirmed for 1.13.1.
How to reproduce
Spawn a cow, start attacking it while sprinting.
Observe how the score will stop increasing after the first hit while you are still sprinting.
confirmed for 1.15 and 1.15.1
Confirmed for 1.17.1