incorrect headYaw parameter when handling SpawnEntity packet
/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
- Start a 1.12.2 server and login with a 1.18.2 client
- Send nms packet to spawn a EntityArmorStand with accurate Location (with yaw and pitch)
- 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.
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
https://dump.viaversion.com/acbfb16bb77344fa9dc354672b16afabf23eb3040b5a818afab077d3a24b6e1a
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?
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.
In order to compare, I switch to 1.18.2 server, and the same code works well.
I use the 1.19.4 client and 1.12.2 server (NMS Version is 1_12_2_R1), the bug repeats every time.
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.
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.