Question 1.20 player input packet

Nouma

New member
Jan 28, 2025
1
0
1
Hello !

I'm making a car dealer plugin, wich needs to play with NMS and packets.
Basically I want the player to be spectating an entity (to move and freeze the camera everywhere I want), in order to have him look a preview car I spawn.

The tricky part is I want the car to rotate when the player is pressing A and D.

To do that I'm listening to the player input packet and everything was fine until, I decided to switch from 1.21.3 to 1.20.4 (big mistake).
Cause basically prior to 1.21 this packet was only sent to the server if the client is riding an entity.

I was wondering "what if I spawn a horse and then make the player ride it" ? Sounds good right ?
Well, it works, but guess what, the client can't be riding an entity and spectating another in the same time.

So I'm wondering if any of you guys have any kind of solution, any shenanigan or workaround, maybe a completely another idea ?
I've been smashing my head on this for a few days now so any suggestions are welcome.

Thanks <3

P.S.: That's what it looks like on 1.21.3 : https://gyazo.com/7291631984d273d6096a484adfb0cad1
 

Cxom

New member
Jan 31, 2025
1
0
1
In the clip, it looks like the camera is not moving. You can make the client ride a display or armor stand which won’t move and still detect their key input, but they’ll be able to (try to) look around with mouse. The best you can do is cancel that movement - it’ll jitter if they try as the client fights the incoming packets. Unfortunately, there’s no way to freeze their look direction perfectly without that jitter for exactly the reason you said, but it’ll look fine as long as they don’t.