Spam Kick Fix

Quick rating

Community listing page, reviews may not be monitored by the author.

Spam Kick Fix

No reviews yet

Stops 'Kicked for spamming' on lagging servers. Separate, configurable chat and command limits for 1.21.1 and 1.21.11.

Mod Loaders
Minecraft
26.3 26.2

About

Description

Your server hits a lag spike, someone types two lines in chat, and they get "Kicked for spamming". That's a long-standing vanilla bug (MC-276819), and this mod fixes it.

Why it happens

Every chat message and command adds to a spam counter, and the counter goes down by one step every server tick. At a healthy 20 ticks a second that works out to about one message a second. When the server lags and runs fewer ticks, the counter barely goes down, so normal chatting adds up and the server kicks the player.

With this mod the counter goes down by the real time that has passed, as if the server had kept up. On a server running at full speed nothing changes.

Your own limits on 1.21.1 and 1.21.11

Minecraft 26.2 counts commands separately from chat and lets you change both limits in server.properties. This mod brings that to 1.21.1 and 1.21.11, so typing a few commands doesn't use up your chat allowance.

The limits are in config/spam_kick_fix.properties:

  • chat-spam-threshold-seconds=10: how many messages a player can send in one burst (it refills at one a second). Set it to 0 and chat never gets anyone kicked.
  • command-spam-threshold-seconds=10: the same for commands.
  • real-time-cooldown=true: the lag fix above.

The two limit names match vanilla 26.2's server.properties settings, which is why they say "seconds".

On 26.2 and newer, the limits are already in server.properties under the same names, so the config file only has the lag fix.

Ops are never kicked for spam, with or without this mod.

FAQ

Client or server? Only the server needs it (or your own game, in singleplayer). Players don't need it to join.

Does it need anything else? No.

I also have Long-Standing Bug Fixes. That's fine. It fixes the lag part as well, and when both mods are installed only one of them does it.

How is it tested? With game tests on 1.21.1, 1.21.11, 26.2 and 26.3, on both Fabric and NeoForge. They check the lag fix, the separate command limit and a limit of 0, and each test has a twin that runs without the mod and checks that vanilla still kicks.

Can I use it in my modpack? Yes, go ahead, no need to ask.

Please report bugs here.

MIT. Developed with AI assistance. Source: https://github.com/cambrova/long-standing-bug-fixes/tree/main/spam-kick-fix