WhosAFK v1.2

A plugin that lists the players who are AFK in the tab list

  1. DrOverbuild
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    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.
    • /afk: This is the main command which will broadcast that the player who executed the command is AFK. An operator can set another player's status to AFK by adding the other player's username as an argument to the command.
    • /whosafkreload: Use this command to reload the config if you make a change to it. Requires the permission whosafk.reload.
    Permissions
    There are three permissions.
    • whosafk.afk: Allows the player to use the command /afk. By default all players have this.
    • whosafk.autoafk: Allows the player to automatically go into AFK mode if he stands still for a while. By default all players have this.
    • whosafk.reload: Allows player to use the command /whosafkreload. By default this is given to operators.
    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
    • auto-afk.enabled: If set to true, the plugin will automatically put players into AFK mode if they do nothing for a configurable amount of time.
    • auto-afk.timeout: This is the number of seconds during which players must do nothing in order to be automatically put in AFK mode.
    • allow-movement-while-afk: If set to false, players will not be able to move until they type /afk.
    • movement-affects-afk: If set to true, players will automatically leave AFK mode if they move or some exterior force moves the player. NOTE: This has no effect if allow-movement-while-afk is set to false.
    • allow-collisions: If set to false, other mobs or players cannot push players in AFK mode, which will push them out of AFK mode.
    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
    • Add Configuration file Done!
    Burakcraft02 likes this.

Recent Updates

  1. v1.2
  2. Small bug fix
  3. Added Events

Recent Reviews

  1. n0dai
    n0dai
    5/5,
    Version: v1.2
    Very nice and lite plugins. I searched it and I found it ! :)
    I suggest you to add lang file, I needed to edit source code for translating.
  2. Burakcraft02
    Burakcraft02
    5/5,
    Version: 1.0
    ==============>Very Super Plugin :)))))))))))))) <==================================================