
Cobblemon: AFK Guard
Cobblemon AFK Guard is a Fabric mod for Minecraft 1.21.1 servers that tracks player presence, marks inactive players as AFK, updates their tab name, and can kick them after a configurable delay.
Screenshots


About this Mod

Cobblemon AFK Guard
Cobblemon AFK Guard is a Fabric mod for Minecraft 1.21.1 servers that tracks player presence, marks inactive players as AFK, updates their tab name, and can kick them after a configurable delay.
It is designed around Cobblemon gameplay and common server-side edge cases, so players are less likely to be kicked while they are actually using Cobblemon features.
Features
- Real AFK timers with optional automatic kick.
- Cobblemon-aware activity handling for battles, battle UI selections, PC usage, Pasture-related interaction, and merchant-style menus.
- Extra GUI activity detection when the mod is installed on both the server and the client.
- Random AFK, return, and kick messages from configurable message lists.
/afk refreshto reload the config without restarting the server.- Manual exemptions, OP bypass, and sleep vote support.
- Supports
$playerplaceholders and Minecraft style codes in messages.
How it works
Server-only install
Server-only is fully supported.
The mod tracks movement, camera changes, chat, commands, normal interactions, inventory actions, merchant actions, and server-visible Cobblemon activity. This includes battle-related packets that reach the server during Cobblemon battles. This is the recommended baseline for most servers.
Server + client install
Installing the mod on both the server and the client enables enhanced activity reporting for client-heavy screens.
This improves AFK detection in interfaces such as Cobblemon battle screens, battle request screens, Cobblemon PC screens, and supported shop screens where some actions may not naturally reach the server as normal interaction packets. This is the best option if you want clicks on Fight, move buttons, Switch, and similar battle UI actions to reset AFK reliably.
Commands
/afktoggles your own AFK state./afk switch <player>toggles AFK for another player./afk exemptionslists manually exempt players./afk exemptions add <player>adds a player to the exemption list./afk exemptions remove <player>removes a player from the exemption list./afk refreshreloads the config file.
Config
The config file is created at:
config/cobblemon_afk_guard.json
Important notes:
- Use
/afk refreshafter editing the file. idleThresholdSecondsis measured in real seconds.kickDelayAfterAfkSecondsstarts counting after the player is marked as AFK.- Message lists choose a random entry each time.
- Use
$playerto insert the player name. - Use
&style codes in the config. For example,&0is treated the same as the vanilla section-sign code for black text. §style codes are also accepted for compatibility.
Default config:
{
"idleThresholdSeconds": 240,
"kickDelayAfterAfkSeconds": 300,
"afkStartMessages": ["&e&o$player is now AFK.", "&e&o$player used Rest."],
"broadcastAfkStart": true,
"afkReturnMessages": [
"&a&o$player is no longer AFK.",
"&a&o$player woke up from Rest."
],
"broadcastAfkReturn": true,
"afkNameFormat": "&7[AFK] &r$player",
"afkKickMessages": [
"&fYou have been kicked for being AFK too long.",
"&fYou have been kicked for being AFK too long. Snorlax won the nap battle."
],
"countExemptPlayersInSleepVote": false
}
Installation
For Minecraft 1.21.1, required:
- Fabric Loader
- Fabric API
- Fabric Language Kotlin
- Cobblemon
1.7.3+1.21.1 - Cobblemon AFK Guard
Optional compatibility:
- Cobbledollars
2.0.0+Beta-5.1
Server install:
- Put the mod jar in the server
modsfolder. - Start the server once to generate the config.
- Edit
config/cobblemon_afk_guard.json. - Run
/afk refresh, or restart the server if you updated the mod jar itself.
Optional client install:
- Put the same mod jar in the client
modsfolder. - Keep the mod on the server as usual.
- Join normally.
Installing on the client is optional, but recommended if you want the best detection inside Cobblemon battle menus and other modded screens.
Compatibility notes
- OPs are ignored by the AFK system.
- Manually exempt players are ignored by the AFK system.
- By default, exempt players do not count toward sleep voting.
- Simply leaving a menu open does not keep a player active. Real interactions are what matter.
- Some modded GUIs cannot be detected perfectly from the server alone, which is why client installation improves accuracy.
Available Versions
How to Install Cobblemon: AFK Guard on Your Server
Order Server
Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).
Set fabric Loader
In the panel under "Egg", select the fabric loader and matching Minecraft version (1.21.1).
Install Mod
Open the mod browser in the dashboard and search for "Cobblemon: AFK Guard". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.
Compatibility
Mod Loaders
Minecraft Versions
1.21.1
Server-side
✓ RequiredRecommended RAM
4 GB(min. 3 GB)Frequently Asked Questions
Cobblemon: AFK Guard server crashes on startup – what to do?
Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.21.1). You can switch loaders with one click in the panel.
Is Cobblemon: AFK Guard compatible with fabric?
Cobblemon: AFK Guard officially supports fabric for Minecraft 1.21.1. The Mado dashboard automatically detects incompatible loader combinations.
Server lagging with Cobblemon: AFK Guard – how to optimize performance?
Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if Cobblemon: AFK Guard consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.
Similar Mods
Rent Modded Server
Install Cobblemon: AFK Guard with just one click on your server.