Back to mods
Chat Lag Fix project artwork

Modrinth · Minecraft mod

Chat Lag Fix

Fixes Minecraft client lag from receiving chat messages (for 1.17 and 1.16)

Choose a version Pick your version below, then grab the matching file.

Quick answer

Which Chat Lag Fix release should I use?

Updated 4 years ago
Latest stable file mc1.17-2.1.0
Game version 1.16.4, 1.16.5, 1.17
Loader Fabric

Chat Lag Fix mc1.17-2.1.0 targets 1.16.4, 1.16.5, 1.17 with Fabric. It must be installed on the client. Do not install it on the dedicated server. No extra mods listed for this file.

Where it goes

Is Chat Lag Fix required on the client, server, or both?

It must be installed on the client. Do not install it on the dedicated server.

Client Required
Dedicated server Not supported
Loader for this release Fabric
Required install it here Optional supported, not mandatory Not supported do not install here Source doesn’t say do not assume

This file is marked client-only.

What else does Chat Lag Fix mc1.17-2.1.0 need?

mc1.17-2.1.0. Change the file and its required mods may change too.

No extra mods listed for this file

This file does not list any required mods. Do not add a library just because a different file uses it.

This file does not list any required or optional mods.

Before you install it

Add Chat Lag Fix without breaking your instance.

Built for Chat Lag Fix mc1.17-2.1.0. Pick another file and the loader, install side or required mods may change.

  1. 01

    Stick to this file

    Use mc1.17-2.1.0. It targets 1.16.4, 1.16.5, 1.17 with Fabric; another release may have different loader, side or dependency requirements.

  2. 02

    Bring the mods it needs

    This file does not list any required mods. Do not add a library just because a different file uses it.

  3. 03

    Put it on the correct side

    It must be installed on the client. Do not install it on the dedicated server.

  4. 04

    Pick the file you checked

    Use the “Get this file” button beside mc1.17-2.1.0. It opens that exact file at the source.

About this project

What does Chat Lag Fix add?

Fixes Minecraft client lag from receiving chat messages

YOU DO NOT NEED THIS MOD ANYMORE ON 1.18


Mojang has fixed the bug in their API that was causing it to return an error instead of an empty list. Minecraft will fetch the block-list once when joining the world. This mod may still improve world loading times by the time it takes to make that HTTP request; especially if you have a slow internet connection.

This comment by a Mojang employee confirms that the bug was fixed: https://bugs.mojang.com/browse/WEB-5587?focusedCommentId=1134973&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-1134973

This bug still affects 1.17 and 1.16 but only on the first chat message received: https://bugs.mojang.com/browse/MC-218167

Technical Details: When receiving a chat message, Minecraft sends a HTTP request in the render thread to check your player block list. The current frame does not finish rendering until this request has finished, causing a lag spike. This mod lets chat messages through until a block-list can be fetched.

Why is this happening now and not before?: something happened to Mojang's API. When joining a world, the blocklist would usually load fine, but Mojang's API has started returning errors for users who have migrated to Microsoft accounts, causing the block list to be fetched in 2 minute intervals when receiving a message.

A commented walkthrough of why the bug occurs
// A simplified view of the code.
private static final long BLOCKLIST_REQUEST_COOLDOWN = 120;
private Instant nextRequest;
private final blockList Set;

// This method is called when receiving a chat message
public boolean isBlockedPlayer(UUID playerID) {
// If we don't have the blocklist yet, fetch it
// Note that when there's an error, fetchBlockList returns null
//
if (this.blockList == null) {
this.blockList = fetchBlockList();
// If we still don't have it, assume the player is not blocked
if (this.blockList == null) {
return false;
}
}
return this.blockList.contains(playerID);
}

public Set fetchBlockList() {
// Only check at least every 2 minutes.
// This is why the lagspike only occurs every 2 minutes or later
if (this.nextRequest == null || Instant.now().isAfter(this.nextRequest)) {
return null;
}
// Reset the 2 minute timer
this.nextRequest = Instant.now().plusSeconds(BLOCKLIST_REQUEST_COOLDOWN);
try {
// Make the HTTP request
BlockListResponse response = minecraftClient.get(routeBlocklist, BlockListResponse.class);
return response.getBlockedProfiles();
} catch (/* exception */) {
// If there's an error return null
return null;
}
}


If you'd like to see the unmodified for yourself, check out com.mojang.authlib.yggdrasil.YggdrasilUserApiService, remember that these methods get called on the render thread, thus blocking the frame from finishing.

GIF demonstration of the bug

Project description from Modrinth.

Pick your setup

Chat Lag Fix by Minecraft version and loader

Choose the version and loader you play, then open the matching release.

6 available setups

Check the dependencies, then try the file in a copied instance before changing a world you care about.

Recent files

Chat Lag Fix versions and loaders

6 of 6 releases match

Looking for an older file? The official Modrinth project page is in Resources.