
"Cannot remove from team" workaround
Eliminate lag spikes on render thread caused by IllegalStateException thrown in Scoreboard.removeScoreHolderFromTeam().
About this Mod
"Cannot remove from team" workaround
On some buggy servers you may have noticeable lag spikes caused by Error executing task on client:
net.minecraft.class_148: Main thread packet handler
at net.minecraft.class_2600.method_11072(class_2600.java:33) ~[client-intermediary.jar:?]
at net.minecraft.class_1255.method_18859(class_1255.java:156) ~[client-intermediary.jar:?]
at net.minecraft.class_4093.method_18859(class_4093.java:23) ~[client-intermediary.jar:?]
at net.minecraft.class_1255.method_16075(class_1255.java:130) ~[client-intermediary.jar:?]
at net.minecraft.class_1255.method_5383(class_1255.java:115) ~[client-intermediary.jar:?]
at net.minecraft.class_310.method_1523(class_310.java:1283) ~[client-intermediary.jar:?]
at net.minecraft.class_310.method_1514(class_310.java:888) ~[client-intermediary.jar:?]
at net.minecraft.client.main.Main.main(Main.java:265) ~[Fabric%201.20.4.jar:?]
at net.fabricmc.loader.impl.game.minecraft.MinecraftGameProvider.launch(MinecraftGameProvider.java:470) ~[fabric-loader-0.15.7.jar:?]
at net.fabricmc.loader.impl.launch.knot.Knot.launch(Knot.java:74) ~[fabric-loader-0.15.7.jar:?]
at net.fabricmc.loader.impl.launch.knot.KnotClient.main(KnotClient.java:23) ~[fabric-loader-0.15.7.jar:?]
Caused by: java.lang.IllegalStateException: Player is either on another team or not on any team. Cannot remove from team 'Z/Sta/517631'.
at net.minecraft.class_269.method_1157(class_269.java:307) ~[client-intermediary.jar:?]
at net.minecraft.class_634.method_11099(class_634.java:2029) ~[client-intermediary.jar:?]
at net.minecraft.class_5900.method_34173(class_5900.java:129) ~[client-intermediary.jar:?]
at net.minecraft.class_5900.method_11054(class_5900.java:14) ~[client-intermediary.jar:?]
at net.minecraft.class_2600.method_11072(class_2600.java:24) ~[client-intermediary.jar:?]
... 10 more
One thing this mod does is it replaces IllegalStateException throwing with LOGGER.warn().
Default net.minecraft.scoreboard.Scoreboard.removeScoreHolderFromTeam() (class_269.method_1157()) implementation:
public void removeScoreHolderFromTeam(String scoreHolderName, Team team) {
if (this.getScoreHolderTeam(scoreHolderName) != team) {
throw new IllegalStateException("Player is either on another team or not on any team. Cannot remove from team '" + team.getName() + "'.");
} else {
this.teamsByScoreHolder.remove(scoreHolderName);
team.getPlayerList().remove(scoreHolderName);
}
}
Though I'm not a Java coding guru, I don't understand why the exception is thrown on render thread.
Available Versions
How to Install "Cannot remove from team" workaround on Your Client
Install the Mod Loader Locally
Install fabric for your local Minecraft version.
Download the Matching File
Choose the "Cannot remove from team" workaround file for fabric and Minecraft 1.20.4.
Install Mod
Place the .jar file in your local .minecraft/mods folder and restart Minecraft. No server-side installation is required.
Compatibility
Mod Loaders
Minecraft Versions
1.20.4, 1.20.3
Server-side
✗ UnsupportedRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
Does "Cannot remove from team" workaround need to be installed on the Minecraft server?
No. Modrinth marks "Cannot remove from team" workaround as unsupported on the server side. Install it only in your local Minecraft mods folder. Your server can remain unchanged unless the mod page lists an additional dependency.
Which version and loader does "Cannot remove from team" workaround require?
Use a file for fabric and your exact Minecraft version. Supported versions include 1.20.4, 1.20.3. Files for different loaders are not interchangeable.
"Cannot remove from team" workaround is not working – what should I check?
First check the Minecraft version, loader version and required dependencies. Put the .jar file in your local .minecraft/mods folder and remove older duplicates. Because this mod is client-side, adding server RAM will not fix it.
Similar Mods
Minecraft Server for Your Group
"Cannot remove from team" workaround stays on your client. Host a compatible world for your group.