SANDBOX — this is a test environment. No servers are actually deployed and no real payments are charged.
✓ VerifiedGameplay & overhauls

Detect AFK Players

by clo4 · for Minecraft

AFK/idle detection that's extremely performant · Players go AFK after 3 minutes (configurable) without moving their mouse · Extend with plenty of add-ons!

30KDownloads
14 mo agoLast updated
MITLicense
Data pack · Fabric +3Loaders

About Detect AFK Players

From Modrinth

AFK/idle detection that's extremely performant · Players go AFK after 3 minutes (configurable) without moving their mouse · Extend with plenty of add-ons!

Detect AFK Players

Detects player inactivity based on head rotation - simple, accurate, and fast. Intended as a dependency for datapacks and server operators.

This doesn't do much without add-ons (better performance), so you'll probably want to download one of those too.

Add-ons

  • Pause Day Cycle - Pauses time when all players are AFK
  • AFK Sleep - Allows sleeping when players are AFK, and handles dimensions + updates correctly unlike alternatives
  • AFK Dim Names - Player names are dimmed when AFK
  • AFK Message - Chat notifications for player status
  • AFK Sit - Players sit down when they're AFK

Core Functionality

  • Tags players as afk after 3 minutes
  • Detection based on head rotation, more accurate than position
  • Significantly better performance than alternatives
  • Modular (see above for add-ons)

To configure how long it takes to become AFK, use the command below. By default, this is set to 3600 (which is 3 minutes).

/scoreboard players set .threshold afk.settings NUMBER_OF_TICKS

To enable players using /trigger afk, use the following command. No players are allowed to become AFK manually unless enabled by an admin.

/scoreboard players enable PLAYER afk

Performance

Common AFK detection methods check X/Y/Z, inventory changes, and block interactions - often on every tick. Instead, this data pack does a single head rotation NBT check per player every 1.5 seconds, resulting in a significantly less computation as compared to alternatives, sometimes by up to two orders of magnitude.

The head rotation method also eliminates false triggers from entity interactions (players attacking, explosions, etc) and anti-AFK automations such as water streams.

API

Two function tags are provided:

  • afk:away - Executed as player on AFK
  • afk:back - Executed as player on return

Additional documentation is provided on GitHub, such as all the stable scoreboard objectives and how to use them.

Example implementation:

kick-afk-players/data/afk/tags/functions/away.json

{ "values": ["afk_kick:kick"] }

kick-afk-players/data/afk_kick/functions/kick.mcfunction

kick @s AFK

Highlights

From source data

Game versions

Supports 24 Minecraft versions, the newest being 1.21.8.

Loaders

Runs on Data pack, Fabric, Forge, NeoForge and Quilt.

Footprint

Rated a light load on a server.

What kind of mod it is

From the catalog
Listed on Modrinth as “Mods”

Gameplay & overhauls

New mechanics, content and overhauls that change how the game plays.

Runs on your server

From source side support

Modrinth lists Detect AFK Players as required on the server. Check its Modrinth page to see whether players need it too.

Compatibility

Game
Minecraft
Loaders
Data packFabricForgeNeoForgeQuilt
Runs on
Serverrequired on the server
Game versions
1.21.8 and 23 earlier

Verified at the source

  • ✓ModrinthOfficial listing, checked 2026-10-01Open ↗
  • ✓Authorclo4, as published on Modrinth
  • ✓LicenseMITFree

Detect AFK Players, answered

Generated from the mod’s own source data.

Do my players need to install Detect AFK Players?

Modrinth lists Detect AFK Players as required on the server. Check its Modrinth page to see whether players need it too.

Which loaders does it support?

Data pack, Fabric, Forge, NeoForge and Quilt.

Is it free?

Yes. Detect AFK Players is free to download from Modrinth. Its license is MIT.

How do I add it to my Nxeon server?

Use “Add to a server” on this page, or open NxLabs from your dashboard. We install it, restart your server and switch it on.

NxLabs

Run Detect AFK Players on a Minecraft server.

Deploy in about a minute from $4.20 a month, then add Detect AFK Players in one click.