{"id":56254,"date":"2026-06-03T05:40:40","date_gmt":"2026-06-03T02:40:40","guid":{"rendered":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/"},"modified":"2026-06-03T05:40:40","modified_gmt":"2026-06-03T02:40:40","slug":"detect-afk","status":"publish","type":"mod","link":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/","title":{"rendered":"Detect AFK Players"},"content":{"rendered":"<p># Detect AFK Players<\/p>\n<p>Detects player inactivity based on head rotation &#8211; simple, accurate, and fast. Intended as a dependency for datapacks and server operators.<\/p>\n<p>This doesn&#8217;t do much without add-ons (better performance), so you&#8217;ll probably want to download one of those too.<\/p>\n<p>## Add-ons<\/p>\n<p>&#8211; Pause Day Cycle &#8211; Pauses time when all players are AFK<br \/>\n&#8211; AFK Sleep &#8211; Allows sleeping when players are AFK, and handles dimensions + updates correctly unlike alternatives<br \/>\n&#8211; AFK Dim Names &#8211; Player names are dimmed when AFK<br \/>\n&#8211; AFK Message &#8211; Chat notifications for player status<br \/>\n&#8211; AFK Sit &#8211; Players sit down when they&#8217;re AFK<\/p>\n<p>## Core Functionality<\/p>\n<p>&#8211; Tags players as `afk` after 3 minutes<br \/>\n&#8211; Detection based on head rotation, more accurate than position<br \/>\n&#8211; Significantly better performance than alternatives<br \/>\n&#8211; Modular (see above for add-ons)<\/p>\n<p>To configure how long it takes to become AFK, use the command below.<br \/>\nBy default, this is set to 3600 (which is 3 minutes).<\/p>\n<p>&#8220;`<br \/>\n\/scoreboard players set .threshold afk.settings NUMBER_OF_TICKS<br \/>\n&#8220;`<\/p>\n<p>To enable players using `\/trigger afk`, use the following command. No players are allowed to become AFK manually unless enabled by an admin.<\/p>\n<p>&#8220;`<br \/>\n\/scoreboard players enable PLAYER afk<br \/>\n&#8220;`<\/p>\n<p>## Performance<\/p>\n<p>Common AFK detection methods check X\/Y\/Z, inventory changes, and block interactions &#8211; 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.<\/p>\n<p>The head rotation method also eliminates false triggers from entity interactions (players attacking, explosions, etc) and anti-AFK automations such as water streams.<\/p>\n<p>## API<\/p>\n<p>Two function tags are provided:<\/p>\n<p>&#8211; `afk:away` &#8211; Executed as player on AFK<br \/>\n&#8211; `afk:back` &#8211; Executed as player on return<\/p>\n<p>Additional documentation is provided on GitHub, such as all the stable scoreboard objectives and how to use them.<\/p>\n<p>Example implementation:<\/p>\n<p>###### kick-afk-players\/data\/afk\/tags\/functions\/away.json<\/p>\n<p>&#8220;`json<br \/>\n{ &#8220;values&#8221;: [&#8220;afk_kick:kick&#8221;] }<br \/>\n&#8220;`<\/p>\n<p>###### kick-afk-players\/data\/afk_kick\/functions\/kick.mcfunction<\/p>\n<p>&#8220;`mcfunction<br \/>\nkick @s AFK<br \/>\n&#8220;`<\/p>\n","protected":false},"excerpt":{"rendered":"<p>AFK\/idle detection that&#8217;s extremely performant \u00b7 Players go AFK after 3 minutes (configurable) without moving their mouse \u00b7 Extend with plenty of add-ons!<\/p>\n","protected":false},"featured_media":56255,"template":"","meta":{"_minecraft_slug":"detect-afk","_minecraft_project_id":"OZdgwUpA","_minecraft_author":"clo4","_minecraft_license":"MIT","_minecraft_downloads":21172,"_minecraft_follows":53,"_minecraft_client_side":"unknown","_minecraft_server_side":"unknown","_minecraft_storage_type":"zip","_minecraft_archive_name":"detect-afk.zip","_minecraft_size_bytes":46573,"_minecraft_version_count":9,"_minecraft_updated_at":"2026-05-15T21:36:27.441834Z","_minecraft_date_created":"2023-08-05T02:54:56.356389Z","_minecraft_date_modified":"2025-07-26T08:58:42.246199Z","_minecraft_project_url":"https:\/\/modrinth.com\/mod\/detect-afk","_minecraft_icon_attachment_id":56255,"_minecraft_imported_at":"2026-06-03T02:40:41+00:00","_minecraft_import_hash":"c6bf0f92f2258e71f42ea3cb76427cd3","_minecraft_versions":"","_minecraft_links":"","_minecraft_gallery":"","_minecraft_api_metadata":""},"mod_category":[84,97,104,873,126,158,98,92],"mod_loader":[86,99,106,160,100],"minecraft_version":[51,52,53,54,55,56,57,58,59,36,60,93,94,101,102,62,37,73,74,38,78,79,80,81],"class_list":["post-56254","mod","type-mod","status-publish","has-post-thumbnail","hentry","mod_category-datapack","mod_category-fabric","mod_category-forge","mod_category-library","mod_category-management","mod_category-neoforge","mod_category-quilt","mod_category-utility","mod_loader-datapack","mod_loader-fabric","mod_loader-forge","mod_loader-neoforge","mod_loader-quilt","minecraft_version-1-18","minecraft_version-1-18-1","minecraft_version-1-18-2","minecraft_version-1-19","minecraft_version-1-19-1","minecraft_version-1-19-2","minecraft_version-1-19-3","minecraft_version-1-19-4","minecraft_version-1-20","minecraft_version-1-20-1","minecraft_version-1-20-2","minecraft_version-1-20-3","minecraft_version-1-20-4","minecraft_version-1-20-5","minecraft_version-1-20-6","minecraft_version-1-21","minecraft_version-1-21-1","minecraft_version-1-21-2","minecraft_version-1-21-3","minecraft_version-1-21-4","minecraft_version-1-21-5","minecraft_version-1-21-6","minecraft_version-1-21-7","minecraft_version-1-21-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.6 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Detect AFK Players - Minecraft<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Detect AFK Players - Minecraft\" \/>\n<meta property=\"og:description\" content=\"AFK\/idle detection that&#039;s extremely performant \u00b7 Players go AFK after 3 minutes (configurable) without moving their mouse \u00b7 Extend with plenty of add-ons!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/\" \/>\n<meta property=\"og:site_name\" content=\"Minecraft\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/\",\"name\":\"Detect AFK Players - Minecraft\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg\",\"datePublished\":\"2026-06-03T02:40:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/#primaryimage\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg\",\"contentUrl\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/wp-content\\\/uploads\\\/2026\\\/06\\\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg\",\"width\":220,\"height\":220},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/detect-afk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Mods\",\"item\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/mods\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Detect AFK Players\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/#website\",\"url\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/\",\"name\":\"Minecraft\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/vpesports.com\\\/minecraft\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Detect AFK Players - Minecraft","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/","og_locale":"en_US","og_type":"article","og_title":"Detect AFK Players - Minecraft","og_description":"AFK\/idle detection that's extremely performant \u00b7 Players go AFK after 3 minutes (configurable) without moving their mouse \u00b7 Extend with plenty of add-ons!","og_url":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/","og_site_name":"Minecraft","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/","url":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/","name":"Detect AFK Players - Minecraft","isPartOf":{"@id":"https:\/\/vpesports.com\/minecraft\/#website"},"primaryImageOfPage":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/#primaryimage"},"image":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/#primaryimage"},"thumbnailUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg","datePublished":"2026-06-03T02:40:40+00:00","breadcrumb":{"@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/#primaryimage","url":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg","contentUrl":"https:\/\/vpesports.com\/minecraft\/wp-content\/uploads\/2026\/06\/detect-afk-icon-e46f04161e6ea87efc02b0063e4a8dd0e5b2f51b.jpeg","width":220,"height":220},{"@type":"BreadcrumbList","@id":"https:\/\/vpesports.com\/minecraft\/mods\/detect-afk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/vpesports.com\/minecraft\/"},{"@type":"ListItem","position":2,"name":"Mods","item":"https:\/\/vpesports.com\/minecraft\/mods\/"},{"@type":"ListItem","position":3,"name":"Detect AFK Players"}]},{"@type":"WebSite","@id":"https:\/\/vpesports.com\/minecraft\/#website","url":"https:\/\/vpesports.com\/minecraft\/","name":"Minecraft","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/vpesports.com\/minecraft\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod\/56254","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod"}],"about":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/types\/mod"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media\/56255"}],"wp:attachment":[{"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/media?parent=56254"}],"wp:term":[{"taxonomy":"mod_category","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_category?post=56254"},{"taxonomy":"mod_loader","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/mod_loader?post=56254"},{"taxonomy":"minecraft_version","embeddable":true,"href":"https:\/\/vpesports.com\/minecraft\/wp-json\/wp\/v2\/minecraft_version?post=56254"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}