PlaceholderAPI integration
Setup
1. Install PlaceholderAPI
# Download PAPI from SpigotMC and drop it in your plugins/ folder
# Then in-game or console:
/papi ecloud download AfkGuard
/papi reload
Warning: If PlaceholderAPI is not installed, all
%afkguard_...%placeholders will display literally as%afkguard_..%.
2. Verify Installation
/papi test <yourname> %afkguard_status%
# Should return: Active (or AFK if you're currently AFK)
Placeholder reference
| Placeholder | Returns | Example Output |
|---|---|---|
%afkguard_status% |
AFK or Active |
Active |
%afkguard_time% |
Time in current AFK session (m:ss) |
3:42 |
%afkguard_count% |
Total AFK players currently online | 4 |
Detailed Descriptions
%afkguard_status%
Returns the player's current AFK status as a human-readable string.
- Returns
AFKwhen the player is marked as AFK - Returns
Activewhen the player is active - Useful for conditional formatting in TAB or chat
%afkguard_time%
Returns how long the player has been in their current AFK session, formatted as m:ss.
- Returns
0:00if the player is not currently AFK - Resets to
0:00when the player becomes active again - Example:
3:42means 3 minutes and 42 seconds AFK
%afkguard_count%
Returns the total number of players currently marked as AFK on the server (integer).
- Useful for server info displays, MOTDs, or scoreboards
- Returns
0when no players are AFK
Usage examples
Animated Scoreboard (e.g. CMI, AnimatedScoreboard)
lines:
- "&7Status: &f%afkguard_status%"
- "&7AFK Time: &e%afkguard_time%"
- "&7AFK Players: &b%afkguard_count%"
TAB Plugin (e.g. TAB by NEZNAMY)
tablist-name: "%player_name% &8| &7%afkguard_status%"
Conditional Formatting with PlaceholderAPI Expansion
# Using CMI or EssentialsX conditions:
# Show gray name if AFK, white if active
name: "{condition: %afkguard_status%=AFK}&7%player_name%&r&7 [AFK]&r|&f%player_name%}"
FeatherBoard / Scoreboard Line
- " &7AFK: &f%afkguard_count% &7players"
Compatible plugins
| Plugin | Works With AfkGuard Placeholders |
|---|---|
| TAB by NEZNAMY | |
| FeatherBoard | |
| CMI | |
| AnimatedScoreboard | |
| Essentials (chat format) | |
| DeluxeChat | |
| HolographicDisplays | (via PAPI bridge) |
Tip: Combine
%afkguard_status%with conditional placeholder plugins likePlaceholderAPI-Expansion-Conditionsto show/hide elements based on AFK state.