fabric-carpet icon indicating copy to clipboard operation
fabric-carpet copied to clipboard

Reset fake player's delta movement when spawning

Open filips123 opened this issue 1 year ago • 6 comments

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.

filips123 avatar Jul 04 '23 08:07 filips123

Is this the right solution though? Likely should instead fix them keeping the speed when being fully killed. Though this fix also makes sense.

altrisi avatar Jul 07 '23 10:07 altrisi

Well, it's probably the easiest way to fix this...

filips123 avatar Jul 07 '23 11:07 filips123

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.

Ghoulboy78 avatar Jul 07 '23 11:07 Ghoulboy78

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.

altrisi avatar Jul 07 '23 13:07 altrisi

so I don't think it should be the thing to care about here.

Wdym by that?

Ghoulboy78 avatar Jul 10 '23 11:07 Ghoulboy78

Can this be merged please? Even if it is not the most correct solution, it should work and is quite simple.

filips123 avatar Jul 07 '24 15:07 filips123