Hi, I'm pretty new to modding. My idea is that the server knows what a real player is doing by processing the packets that it receives from the real player. Theoretically, if we had a list of timestamped packets and provided them to the server in some way that attributed them to a fake player (ServerPlayerEntity), then the server would move the fake player accordingly exactly as though it were a real player.
Then, we could do fun things like listen to a real player's packets, and resend them to the server on behalf of the fake player on a 5 second delay, and the fake player would repeat all of the real player's actions on a 5 second delay. We could even create a fake player on a totally different server from the real player, and livestream packets from the real player to the other server where a fake player recreates their actions (this is the main goal; synchronize player actions across two servers by passing packets between them).
I currently am using the carpet mod's fake serverPlayerInterface and FakeClientConnection, and am successfully able to spawn a clone of a player when that player joins the world. However, because the connection is fake, I don't know how to send packets to the server, and mocking the entire connection seems prohibitively difficult for me. Is there another approach I should use, or a way to proceed with this approach?
Thanks for the help