Plugin Release NoChatLagServer | Fixes chat lag spikes

A couple of days ago, something changed in Mojang's blocked users API, causing the client to not properly load the list of blocked users on start. Because of this, the client will attempt to fetch the blocklist every two minutes when the chat is being rendered. This loading is done on the same thread as the rendering, causing the game to freeze until Mojang's API returns a response. Since the requests takes a while to complete, this will cause a noticeable lag spike.

NoChatLagServer fixes this bug by setting the sender-uuid to that of the server for every chat message. Since messages sent by the server itself bypass the block check, this will prevent the lag spikes from happening, with the side effect of completely breaking the blocking system. After removing the sender UUID, the client will still attempt to parse the username when using the standard chat format (<sender> message). The config option invisibleNameCharacter exists to combat this. It'll add an extremely small character in front of the player's username, causing the client parsing to not find any players. This may have the side effect of breaking bots and mods attempting to find the author of a message by parsing chat. This option will do nothing if you're not using the default chat format.

If you don't want the block list broken, check out my client-side fabric mod, NoChatLag.

Requires ProtocolLib

This issue is being tracked in Mojira issue WEB-5587.
 
Last edited:
D

Deleted member 94

Guest
I have tried this on my server but I am still having the 2 minute lag spike. I think this is my issue but I do not know what to troubleshoot. I am using fresh paper server with just protocollib and NoChatLagServer with two vanilla client on same Windows 11 PC. Please advise.
 

electronicboy

Administrator
Staff member
Dec 11, 2021
225
10
38
28
are you using a chat plugin?
iirc, mojang has some logic in the client to match names when there is no proper UUID there
 
D

Deleted member 94

Guest
I use VentureChat chat plugin on production server but for test I use fresh server. I will conduct further investigation or attach debugger to client. I think this will find issue quickly.
 
D

Deleted member 94

Guest
yes that will make sense, this plugin will not work :(

I will change format of my chat or add zero width space (I am not sure how Minecraft Client renders) to avoid on my server.
 
D

Deleted member 94

Guest
I fix on my server by replace <player> with [player] in chat. This is not very good plugin, it will not work.
 

Noah

Paper Developer
Staff member
Jan 4, 2022
44
6
16
8
The Netherlands
Thanks for letting me know. I've just released a new update that fixes this. When using the standard chat format, it'll inject a miniscule character (greek tonos) in front of the players name, since Minecraft doesn't seem to have any invisible characters.

- Adds a new config option, invisibleNameCharacter
After removing the sender UUID, the client will still attempt to parse the username when using the standard chat format (<sender> message). The config option invisibleNameCharacter exists to combat this.
It'll add an extremely small character in front of the player's username, causing the client parsing to not find any players. This may have the side effect of breaking bots and mods attempting to find the author of a message by parsing chat.
This option will do nothing if you're not using the default chat format.​