⚡
AFKToSpawn ⚡
Teleport idlers to spawn, show AFK status (bossbar + tab), per-rank timers, PAPI placeholders, Essentials & Floodgate hooks.
By: Silverninja3_
Highlights
AFK → Teleport to Spawn: Detects inactivity (or via /afk) and teleports safely. Supports global/world or serverspawn (Essentials /spawn) modes.
Per-Rank AFK Timers: Different timeouts per LuckPerms group (e.g., member 10m, donor 5h).
Bossbars + Welcome Back: Stylish AFK bossbar (MiniMessage gradients) and a “Welcome back!” bossbar on return.
TAB-Friendly Suffix: AFK suffix placeholders for name formats (legacy & colors or MiniMessage).
PlaceholderAPI: Full expansion: suffixes, status, per-group minutes, time remaining.
EssentialsX Hook: Optionally override Essentials’ AFK and run /spawn via console.
Floodgate/Geyser Hook: Bedrock players tracked consistently (reflection, no hard dependency).
Config Reload: [/afkreload] live-reloads everything (including PAPI registration).
- Hex/Gradients + Legacy &: Messages accept both MiniMessage and legacy [&] codes.
Commands
/afk — Toggle/trigger AFK immediately (teleports per config).
/afkreload — Reload plugin configuration and re-register placeholders.
Permissions
afkspawn.afk — Use /afk (default: true)
afkspawn.reload — Use /afkreload (default: op)
- afkspawn.bypass — Bypass AFK teleport (default: false)
Placeholders (PlaceholderAPI)
Use either identifier:
%afkspawn_%
%spawntoafk_% (alias)
%afkspawn_status% → “AFK” or empty.
%afkspawn_suffix% → plain suffix: [AFK].
%afkspawn_coloredsuffix% → legacy & colored suffix: &7[&6AFK&7] (great for TAB).
%afkspawn_minisuffix% → MiniMessage suffix: <gray>[<gold>AFK</gold>]</gray>.
%afkspawn_groupminutes% → player’s configured AFK timeout (minutes).
%afkspawn_timeremaining% → minutes remaining until AFK triggers (0 if already AFK).
Quick TAB Setup
Recommended (legacy colors):
Code (Text):
tablist-name-formatting:
enabled: true
anti-override: true
formatting: "%luckperms_prefix%%player_name%%afkspawn_coloredsuffix%"
Refresh (optional):
Code (Text):
placeholderapi-refresh-intervals:
"%afkspawn_coloredsuffix%": 100
Important: Do
not map the text placeholder to yes/no. Remove blocks like:
Code (Text):
placeholder-output-replacements:
"%afkspawn_suffix%":
"yes": "&c&l AFK"
"no": ""
If TAB blocks team edits, set our config:
afk-status.use-team-suffix: false (and use placeholders as above).
Configuration (key parts)
Code (Text):
# Minutes of inactivity before AFK action
afktimeout-minutes: 60
Per-group override (LuckPerms primary/inherited group names)
group-timers:
member: 10
vip: 60
elite: 120
legend: 240
mythic: 300 # 5h
Teleport destination
spawn-type: serverspawn # serverspawn | world | global
Message when teleported (MiniMessage OR legacy & supported)
teleport-message: "&7You were &6AFK &7and have been sent to &aspawn&7!"
AFK status visuals
afk-status:
enabled: true
use-team-suffix: false
tab-suffix: " <gray>[<gold>AFK</gold>]</gray>"
tab-suffix-plain: " [AFK]"
tab-suffix-legacy: " &7[&6AFK&7]"
bossbar:
enabled: true
title: "gradient:#ffaa00:#ff0066<bold>AFK</bold></gradient> — move to return"
color: PINK
overlay: PROGRESS
welcome-back:
enabled: true
title: "&a&lWelcome back!"
color: GREEN
overlay: PROGRESS
duration-seconds: 5
Integrations
integrations:
essentials:
override-afk: true # keep Essentials AFK from taking over
hard-hook: true # cancel Essentials AfkStatusChangeEvent
console-spawn: true # run "spawn <player>" as CONSOLE
floodgate:
enabled: true
prefer-java-uuid: true # normalize Bedrock to linked Java UUID when available
Installation
Drop the jar into /plugins on Paper/Spigot 1.21.4.
install PlaceholderAPI (required for placeholders).
Install LuckPerms if you want per-group timers.
* Install EssentialsX if you want “serverspawn” to run its /spawn.
Restart the server, then run: /afkreload.
Compatibility Notes
if /afk conflicts with Essentials, use /afkspawn:afk, or alias /afk to us in commands.yml, or disable Essentials’ /afk.
If TAB logs “Blocked attempt to add player into team AFK_STATUS”, set use-team-suffix: false (and use placeholders).
- Floodgate/Geyser supported via reflection—no extra dependency required.
Changelog (Summary)
New: Floodgate (Geyser) normalization for Bedrock players.
New: PAPI auto-registers expansions on startup and /papi reload.
Per-group AFK timers (LuckPerms).
Bossbar AFK + welcome back messages.
Essentials hard-hook toggle + console /spawn option.
MiniMessage gradients & legacy [&] color support.
- /afkreload command.
Questions or feature requests? Reply on the resource — I’ll help you wire it up!