AFK Module
Configuration Referenceβ
| Key | Type | Default | Description |
|---|---|---|---|
| enabled | boolean | true | Enable or disable the AFK module |
| block-commands | boolean | true | Prevent execution of non-whitelisted commands while AFK |
| whitelisted-commands | string[] | [helpop, msg, r, tell, whisper, w, afk, firebox:afk] | Commands allowed during AFK |
| reset-afk-time-on-quit | boolean | true | Reset AFK timer when player quits (does not reset reward claims) |
| region-task-delay-ticks | number | 60 | Frequency (in ticks) of region AFK checks |
| give-mode | "TIMER" | "CHANCE" | TIMER | Mode for awarding rewards |
| zone-mode | "TP" | "REGION" | "BOTH" | BOTH | Mode determining AFK zone behavior |
| chance-mode-time | number | 2 | Interval (in seconds) for chance-based reward checks |
| show-afk-status | boolean | false | Show AFK status in the action bar |
| show-afk-title | boolean | false | Show AFK title on the playerβs screen when AFK is active |
| afk-rewards | object[] | [] | List of reward configurations (name, permission, needed-time, actions) |
Featuresβ
- Block configurable commands while AFK
- Reset AFK timer on quit without affecting reward claims
- Support for TIMER and CHANCE reward modes
- Region-based AFK counting with configurable tick delay
- Customizable AFK rewards with permissions and claim limits
- Action bar and title notifications for AFK status
Mode Descriptionsβ
Give Modeβ
- TIMER: Grants rewards at fixed intervals. Each
needed-timeseconds the specified reward is awarded. - CHANCE: Every
chance-mode-timeseconds the plugin performs a random check; if the check succeeds, the reward is granted. This allows for probabilistic reward distribution over time based onneeded-timeas the weight.
Zone Modeβ
- TP: Only counts AFK time when the player is teleported to a designated AFK region (e.g., using a command).
- REGION: Counts AFK time only when the player remains within configured region areas (requires proper WorldGuard regions).
- BOTH: Enables both TP and REGION checks; AFK time is counted when either condition is met.
Exampleβ
enabled: true
block-commands: true
whitelisted-commands:
- helpop
- msg
- r
- tell
- whisper
- w
- afk
- firebox:afk
reset-afk-time-on-quit: true
region-task-delay-ticks: 60
give-mode: TIMER
zone-mode: BOTH
chance-mode-time: 2
show-afk-status: false
show-afk-title: false
regions:
- world: world
mode: WHITELIST
regions:
- region1
- region2
afk-rewards:
- name: "&a&lDefault Reward"
permission: ""
needed-time: 60
max-claims: 5
actions:
- "chat: &aYou have been rewarded for being afk for 60 seconds!"
- "console: give %player_name% diamond 1"
- name: "&a&lVIP Reward"
permission: vip
needed-time: 120
max-claims: -1
actions:
- "chat: &aYou have been rewarded for being afk for 120 seconds and being vip!"
- "console: give %player_name% diamond 5"