Hitting mobs affects stamina consumption when running / swimming [1.20.1]
Eeviika opened this issue ยท 2 comments
When attacking any mob while the runningAndSwimmingConsumesStamina config option is set to true, attacking a mob causes the mod to forget you were swimming / sprinting / etc.
This does not affect paragliders (as you can't attack while using one anyways).
Here's a recording of both instances happening. This was running on 1.20.1 with only Fabric API and Paragliders installed.
You can also see me very briefly stop swimming / sprinting when attacking even though I haven't let go of the sprint key, not sure why this happens but this could be causing the aforementioned issue.
Minecraft's own movement logic has an oversight where if the running state on client gets changed twice in one tick, it does not report the change to the server. Players are actually supposed to stop running after attack, and this is enforced in both server and client; you can test this out by running with double tap and attacking, the player should correctly stop running in both sides. However, the client can actually start running again within same tick with run button (ctrl), which doesn't produce syncing packet normally sent on end-of-tick, because player's running state hasn't changed when compared to previous tick's state. #69 describes similar issue caused by the same code.
Previously I just let the issue go because it's an external issue, but maybe Paraglider providing patch for it isn't that bad.