Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reset fake player's delta movement when spawning #1755

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

filips123
Copy link
Contributor

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.

Copy link
Contributor

@Ghoulboy78 Ghoulboy78 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good.

@altrisi
Copy link
Collaborator

altrisi commented Jul 7, 2023

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

@filips123
Copy link
Contributor Author

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

@Ghoulboy78
Copy link
Contributor

Ghoulboy78 commented Jul 7, 2023

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.

@altrisi
Copy link
Collaborator

altrisi commented Jul 7, 2023

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.

@Ghoulboy78
Copy link
Contributor

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

Wdym by that?

@filips123
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fake Player knockback on death is applied at respawn
3 participants