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

Fake Player knockback on death is applied at respawn #1058

Open
James103 opened this issue Aug 13, 2021 · 2 comments · May be fixed by #1755
Open

Fake Player knockback on death is applied at respawn #1058

James103 opened this issue Aug 13, 2021 · 2 comments · May be fixed by #1755
Labels
bug Something isn't working

Comments

@James103
Copy link
Contributor

As of Carpet mod 1.4.45, when you kill a fake player using an attack that deals knockback, the knockback is applied when the fake player respawns. This causes /player ... spawn at x y z to end up positioning the fake player 2-6 blocks away, depending on the knockback dealt.

I would suggest that either:

  • The fake player stays online for 20 ticks after death (same as real players), during which the knockback is applied.
  • /player ... spawn at x y z should cancel the fake player's momentum on respawn.

This is caused by the Motion tag saved into the fake player's data being the motion vector with the knockback applied instead of without, for example [0.7, 0.4, 0.0] with knockback, [0.0, ~-0.1, 0.0] without knockback.

Modlist (MC 1.17.1):

Mods:
  [✔️] advancementinfo-1.17.1-fabric0.36.1-1.2.1
  [✔️] carpet-extra-1.17.1-1.4.43
  [✔️] fabric-api-0.37.2+1.17
  [✔️] fabric-carpet-1.17.1-1.4.45+v210811
  [✔️] itemscroller-fabric-1.17.1-0.15.0-dev.20210707.005506
  [✔️] litematica-fabric-1.17.1-0.0.0-dev.20210713.103711
  [✔️] malilib-fabric-1.17.1-0.10.0-dev.24
  [✔️] minihud-fabric-1.17.1-0.19.0-dev.20210707.150016
  [✔️] notenoughcrashes-3.4.0+1.17-fabric
  [✔️] tweakeroo-fabric-1.17.1-0.10.0-dev.20210710.155746
@Ghoulboy78
Copy link
Contributor

Ghoulboy78 commented Jan 4, 2022

It would be instructive to find out what happens in the following cases:

  • Real player logging in, then being killed, then logging back in (as control to check that it's not just vanilla bug)
  • Real player logging in, then being killed, then spawned back in using /player
  • Fake player spawned using /player, then being killed, then really logging in

I will do these tests and then report results.

Results:
Bug only occurs when fake player is killed with knockback, and then spawned back in as a fake player. In any other case, presumable client anti-cheat or smth kicks in and tells server the previous motion, and the player doesn't experience weirdness.

@Ghoulboy78
Copy link
Contributor

Ghoulboy78 commented Jan 4, 2022

I can think of 2 solutions:

  1. Just delete all the fake player's momentum when spawning in
  2. Figure out some way to make death last 20 ticks longer like James said to mitigate issue.

IMO first solution sounds easier to implement, tho second sounds less intrusive.

Edit:
I somehow didn't notice that these two were the solutions which James proposed in the title of the issue, and I now feel more than a little silly for restating what has already been said. However, I think there are more potential solutions, and do not know which of them is better.

@altrisi altrisi added the bug Something isn't working label Apr 4, 2022
filips123 added a commit to filips123/fabric-carpet that referenced this issue Jul 4, 2023
@filips123 filips123 linked a pull request Jul 4, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants