fabric-carpet
fabric-carpet copied to clipboard
Reset fake player's delta movement when spawning
With this PR, fake player's delta movement (momentum) is reset when the player is spawned. This is done to prevent knockback from the previous death from being applied. This should fix #1058.
Is this the right solution though? Likely should instead fix them keeping the speed when being fully killed. Though this fix also makes sense.
Well, it's probably the easiest way to fix this...
Is this the right solution though? Likely should instead fix them keeping the speed when being fully killed.
I'm not so sure, because spawning fake players is typically done either in creative for testing, or in survival for farms. In survival, you want to spawn the bot in the afk location and not have it move around due to residual knockback, and in creative, you might be trying to align the bot in a specific location, in which case having it move around is also a bad idea.
Though I do agree that another way of solving it would instead be to cancel all momentum when the bot dies, rather than when it's spawned in, in case the actual player spawns in, that way they won't get any residual knockback either.
Actually yeah it makes sense that when you are spawning a fake player you always want it to stay there, although if it was a real player that had actual movement that spawning them would reset it for when they log back in. Though there's a lot more like that, so I don't think it should be the thing to care about here.
so I don't think it should be the thing to care about here.
Wdym by that?
Can this be merged please? Even if it is not the most correct solution, it should work and is quite simple.