Sueta

NeverIdle

2018-01-22

Stop those pesky AFK bypassers.

·Plugin

NeverIdle aims to make bypassing AFK detection a bit more difficult with the tradeoff of being slightly more sensitive for legitimate users. NeverIdle accomplishes this by not considering a user to be active if they're near certain blacklisted materials (water, rails, etc.) and only updating the player's last activity when they move a configured amount of blocks from their last known active point.

You can hook into NeverIdle to determine the AFK status of a player and embed any other restrictions you may wish to.

Features

  • Automatically detect when a player is away
  • Automatically kick idle players after a configured period of time
  • Different kick timers based on different permission nodes
  • Configurable "nearly-full" mode to have higher AFK timers when your server isn't so busy
  • Configurable ignored materials

Dependencies

There are no required dependencies (besides the knowledge that this plugin is built against Spigot 1.8).

If you wish to have countdowns and notifications to players be displayed as titles, please install TitleAPI on your server: https://github.com/ConnorLinfoot/TitleAPI

If you don't have TitleAPI installed, NeverIdle will just use chat messages (which may get kinda spammy).

Permissions

  • neveridle.bypass - Never receive an AFK countdown and never be kicked for being idle
  • neveridle.timer.<name> - Permission to use a specific timer

Configuration
The default config:

warning-delay: 5 minutes
movement-requirement: 5
kick-timers:
  vip: 1 hour
  premium: 30 minutes
  default: 10 minutes
nearly-full:
  enabled: false
  player-count: 150
  empty-multiplier: 2
ignore-materials:
- WATER
- RAILS
- STATIONARY_WATER
- PISTON_BASE
kick-message: '&c&lYou were idle for too long!'
  • warning-delay - How long to wait before counting down the AFK status to a user. This is also how long a user must be idle to be considered AFK
  • movement-requirement - Players will need to move this many meters when considered AFK to regain their active status
  • kick-timers - The various timers. See Custom Timers below
  • nearly-full.enabled - Whether or not to enable the nearly-full system
  • nearly-full.player-count - The player count that needs to be reached for your server to be considered nearly full
  • nearly-full.empty-multiplier - When your server player count is below the above number, how much to multiply AFK timers by
  • ignore-materials - A list of Materials that will prevent player activity from being updated (See: https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html)
  • kick-message - The message to kick a player for who has been idle too long. Color codes and new line characters accepted.

Custom Timers
You can make an unlimited amount of kick timers for your groups and players. Kick timers are assigned and tested as permission nodes, so it's a good idea to negate any timer nodes from groups/users that you don't want them to inherit.

Let's look at the default 3:

kick-timers:
  vip: 1 hour
  premium: 30 minutes
  default: 10 minutes

Going from the defaults, this would mean anyone with the permission node neveridle.timer.vip can AFK for 1 hour before being kicked, and everyone with neveridle.timer.premium can for 30 minutes.

The Default timer is given to anybody who doesn't have any other nodes. You do not have to give a node for the default timer.

API
Hooking into NeverIdle to test for AFK status is easy enough. You can get the ActivityManager from any instance of the plugin

ActivityManager activityManager = NeverIdle.getInstance().getActivityManager();

From the activity manager, you can test if a user is currently away, get their last activity time or position, or force an update check.

Support & Suggestions
NeverIdle is maintained by the Melon Development team. Please contact us for feedback and help: http://melondev.co/contact

Similar projects

Plugin →