Home›Java›Mods›WhosAFK
There are some plugins that broadcast when a player has gone AFK. That's fine, but if a player joins after the broadcast, how is that player going to know that the first player is AFK? This plugin solves that problem.

When a player goes AFK, the plugin will turn their player's name blue and will put the characters "(AFK)" at the end of their name in the tab list. Other players will know this player is going AFK because the server broadcasts that the player is AFK, and players who miss the broadcast simply have to hold down tab to view those who are AFK.

Players who are AFK will not take damage or lose hunger.

Commands
There are two commands.
Permissions
There are three permissions.
Configuration
This is the default config:
Code (Text):
auto-afk:
  enabled: true
  timeout: 60
allow-movement-while-afk: true
movement-affects-afk: true
allow-collisions: false
Other Info
This plugin uses the scoreboard's teams. When the plugin is enabled, the plugin will create the team called "afkers" if it doesn't exist already. It will set the team color to blue and set the team suffix to " (AFK)" if the team is created. When players type /afk, they will be put into the "afkers". Once they type /afk again, or somehow else leave AFK mode, they will be taken out of the "afkers" team, and will not be in a team afterward.

If allow-collisions is set to true in the config, the team's collisions rule is set to NEVER when the plugin is loaded or reloaded. Otherwise, the team's collisions rule is set to ALWAYS.

API Documentation
WhosAFK calls an event when a player goes into AFK mode (either by command, or automatic) and when a player leaves AFK. Here's an example:

Code (Text):
    @EventHandler
    public void playerGoesIntoAFKMode(AFKStatusOnEvent e){
        // Set a custom message:
        e.setMessage(ChatColor.YELLOW + "- " + e.getPlayer().getName() + " is now AFK");
        // Disable the message
        e.setMessage(null);

        // Cancel the event
        e.setCancelled(true);
    }

    @EventHandler
    public void playerLeavesAFKMode(AFKStatusOffEvent e){
        // Set a custom message:
        e.setMessage(ChatColor.YELLOW + "- " + e.getPlayer().getName() + " is no longer AFK");
        // Disable the message
        e.setMessage(null);

        // Cancel the event
        e.setCancelled(true);
    }

Source Code
The source code is on GItHub. Click here to view on GitHub.

To-do List

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

WhosAFK is a free Minecraft Java mod. Compatible with Minecraft 1.7, 1.8, 1.9, 1.10 and newer. Downloaded 57,359 times (via Spigot). Download it and open it directly in the game.

Explore more