Server lag can result in chat/commands being processed out of order
When a server is lagging and a player sends a command very shortly before a chat message, one has to wait for the main thread, the other doesn't, and is thus processed in the wrong order => Player is kicked for sending an out-of-order command.
Also reproducible with this code and at least a slight bit of lag:
minecraft.getConnection().send(new ServerboundChatCommandPacket("msg kennytv This is a command", Instant.now(), ArgumentSignatures.empty(), false)); final MessageSigner signer = MessageSigner.create(this.getUUID()); final String chatMessage = "This is a chat message"; final MessageSignature signature = signMessage(signer, Component.literal(chatMessage)); minecraft.getConnection().send(new ServerboundChatPacket(chatMessage, signature, false));
Resulting server logs:
[22:18:37] [Server thread/INFO]: kennytv joined the game
[22:19:30] [Server thread/WARN]: kennytv sent out-of-order chat: 'msg kennytv This is a command'
[22:19:30] [Server thread/INFO]: <kennytv> This is a chat message
[22:19:30] [Server thread/INFO]: kennytv lost connection: Out-of-order chat packet received. Did your system time change?
[22:19:30] [Server thread/INFO]: kennytv left the game
2022-06-08, 08:24 PM
2022-06-21, 07:13 AM
2022-06-14, 04:31 PM
6
8