ViaVersion icon indicating copy to clipboard operation
ViaVersion copied to clipboard

incorrect headYaw parameter when handling SpawnEntity packet

Open SerendipityR-2022 opened this issue 10 months ago • 7 comments

/viaversion dump Output

https://dump.viaversion.com/dc7acbd9430a95692851073648a6a7072aa0824862075d35330a5b1aca291faa

Server/Client Error

NO ERRORS IN CONSOLE.

Bug Description

Sending SpawnEntity packet on legacy server (like 1.12.2) to a newer version of client (like 1.18.2) cause the parameter headYaw to become a unpredictable value.

Steps to Reproduce

  1. Start a 1.12.2 server and login with a 1.18.2 client
  2. Send nms packet to spawn a EntityArmorStand with accurate Location (with yaw and pitch)
  3. The armor stand will face to a random direction

Expected Behavior

If using a newer version of server, the headYaw will always equal to yaw. The legacy version of server should do the same.

Additional Server Info

No response

Checklist

  • [x] Via plugins are only running on EITHER the backend servers (e.g. Paper) OR the proxy (e.g. Velocity), not on both.
  • [x] I have included a ViaVersion dump.
  • [x] If applicable, I have included a paste (not a screenshot) of the error.
  • [x] I have tried the latest build(s) from https://ci.viaversion.com/ and the issue still persists.

SerendipityR-2022 avatar Feb 16 '25 15:02 SerendipityR-2022

Platform: git--Paper--1581%20%28MC%3A%201.12.2%29 ViaVersion (5.2.1): 21 commits behind master

Please update all Via* plugins from https://ci.viaversion.com/.In case the issue still persists send the new dump and the issue will be reopened

Barvalg avatar Feb 16 '25 15:02 Barvalg

https://dump.viaversion.com/acbfb16bb77344fa9dc354672b16afabf23eb3040b5a818afab077d3a24b6e1a

SerendipityR-2022 avatar Feb 16 '25 15:02 SerendipityR-2022

Platform: git--Paper--1581%20%28MC%3A%201.12.2%29 ViaVersion (5.2.2-SNAPSHOT): Even with master

Barvalg avatar Feb 16 '25 15:02 Barvalg

This is most likely something which is broken on your side, we did not change the value of the head yaw a single time in ViaVersion. Can you maybe identify the exact version where this starts to break and provide your code?

FlorianMichael avatar Apr 07 '25 22:04 FlorianMichael

Here is the source code of my plugin. I tried to spawn an EntityArmorStand and set player's camera on it to fix the pov. However, the head direction is always wrong. NMSUtil.java TaskUtil.java Thus, I installed an PacketLogger farbic mod, and found the headYaw caused this. Image In order to compare, I switch to 1.18.2 server, and the same code works well. Image I use the 1.19.4 client and 1.12.2 server (NMS Version is 1_12_2_R1), the bug repeats every time.

SerendipityR-2022 avatar Apr 09 '25 12:04 SerendipityR-2022

the exact version where this starts

I don't know the exact version where this starts. I also tried 1.8.8 server, and the bug still exists. I think it appears in all legacy version of servers.

SerendipityR-2022 avatar Apr 09 '25 12:04 SerendipityR-2022

UPDATE: I actually solved the problem by sending another packet(PacketPlayOutEntityHeadRotation) to modify headYaw, but I still think that the headYaw should equal to yaw when the spawn packet is sent.

SerendipityR-2022 avatar Jun 02 '25 11:06 SerendipityR-2022