mojira.dev
MC-252141

Small downwards motion applied to player when receiving knockback

 

Within LivingEntity, the travel method applies gravity to all entities after the check

else if (!this.isNoGravity()) {

But this is incorrectly(I assume) applied to the player as well, resulting in a small downwards force whenever a player receives a knockback, which gets magnified significantly by the other issue with knockback(see my other issue).

Proposed solution: add 

&& !(this instanceof Player)

as an additional check, since player's gravity is handled client side and servers should not worry about it.

 

P.S. The downwards motion is -0.08(gravity) * 0.9800000190734863(Movement multiplier) = -0.0784000015258789, which is the downwards motion you get when you are on the ground and takes damage.

Edit: Found a pitfall when attempting to patch it myself, in the Entity class, player's "onGround" status is controlled by the player being falling in the server's perspective, which would cause the player to not be on ground for a majority of the time, to replicate the exact effect of what happens before the patch, the original check of movement.y < 0 should be changed to `movement.y < 0 || this instanceof ServerPlayer && movement.y - (((ServerPlayer) this).hasEffect(MobEffects.SLOW_FALLING)? 0.01D : 0.8D) * 0.9800000190734863D < 0.0D`.

Linked issues

Comments 4

Yes, a small amount of downwards motion is added in every motion packet sent to the player.

I'm pretty sure that this would be considered a duplicate of MC-71781 which was later resolved as "Works As Intended". MC-71781 could be updated to include that the core issue here can also be seen when the player takes fall damage.

O-o how the heck is "entity gravity" which is not applicable to players because player gravity is client side an "intended feature"?

And the frustrating thing this + high network delay causes is fundamental, either this gets fixed or people are gonna get their jumps eaten after fall damage with a high network delay, absolutely mutually exclusive.

I'd say that this one should be keep open so Mojang can evaluate if this is truly a bug based on the code analysis, as this also might affect other cases than just MC-71781.

shuaiouke

(Unassigned)

Plausible

Platform

Normal

Player

1.18.2, 1.19.1

Retrieved