Pack: AFK Display - teakivy/teaks-tweaks GitHub Wiki

Pack: AFK Display (afk-display)

AFK Display shows the server when a player goes AFK. Being "AFK" means they have not moved for at least 5 minutes.

Showcase


Config

The config for this pack can be found in the config.yml file for the plugin.

# AFK Display
# Gray out a players name that is not moving for 5 minutes.
#
# Commands:
# /afk (Permission: teakstweaks.command.afk)
# /afk uninstall (Permission: teakstweaks.command.afk.uninstall)
afk-display:
  enabled: false
  # Whether or not to display [AFK] before an AFK players name
  display-badge: true
  # Badge to show when afk
  badge: '<gray>[AFK]'
  # Color to change the player's name to when they are AFK (or 'none' to not change the color)
  name-color: 'gray'
  # How long a player needs to be still before getting AFK'
  afk-after: 5
  # How long (in minutes) a player needs to be AFK before they get kicked from the server
  # Use '-1' to never kick, use '0' to kick immediately, use '60' to kick after 1 hour, etc.
  kick-after: -1
  # Message to show when AFK Kicked
  kick-message: You have been kicked for AFK!
  # Whether or not users can run '/afk' to mark themselves as AFK
  allow-afk-command: true
  # Message settings
  message:
    # Whether or not to display the AFK message to the player afk
    display-to-self: true
    # Whether or not to display the AFK message to everyone other than the afk player
    display-to-everyone: false
    # Whether or not to display the AFK message to Server Console
    display-to-console: true

Options

enabled

  • Type - boolean
  • Default - false
  • Description - Controls whether the pack is enabled.

display-badge

  • Type - boolean
  • Default - true
  • Description - Controls whether to show the [AFK] badge before a player's name when they have gone AFK.

badge

  • Type - string
  • Default - <gray>[AFK]
  • Description - Sets the badge to display before a player's name when they are AFK.

name-color

  • Type - string
  • Default - gray
  • Description - The color of the player's name when they are AFK.

afk-after

  • Type - int
  • Default - 5
  • Description - How long a player needs to be still for before going AFK.

kick-after

  • Type - int
  • Default - -1
  • Description - How long (in minutes) a player needs to be AFK before they get kicked from the server.
  • Note - Use -1 to never kick, or use 0 to kick immediately.

kick-message

  • Type - string
  • Default - You have been kicked for AFK!
  • Description - The message to show to players when they are kicked for AFK

allow-afk-command

  • Type - boolean
  • Default - true
  • Description - Allows players to set themselves as AFK by using the command /afk

message

  • Type - section
  • display-to-self
    • Type - boolean
    • Default - true
    • Description - Controls whether to display the AFK message to the player who is AFK
  • display-to-everyone
    • Type - boolean
    • Default - false
    • Description - Controls whether to display the AFK message to everyone other than the AFK player
  • display-to-console
    • Type - boolean
    • Default - true
    • Description - Controls whether to display the AFK message to server console

Linked Commands

Permissions

teakstweaks.command.afk

  • Default - true
  • Description - Controls whether the player can set themself as AFK using the /afk command.

teakstweaks.command.afk.uninstall

  • Default - op
  • Description - Controls whether the player can uninstall the AFK pack using /afk uninstall

Messages

"afk_display.name": "AFK Display",
"afk_display.description": "Gray out a players name that is not moving for 5 minutes.",
"afk_display.self_now_afk": "<yellow>You are now AFK.",
"afk_display.self_not_afk": "<yellow>You are no longer AFK.",
"afk_display.other_now_afk": "<gold><player><yellow> is now AFK.",
"afk_display.other_not_afk": "<gold><player><yellow> is no longer AFK.",

afk_display.name

  • Default - AFK Display

afk_display.description

  • Default - Gray out a players name that is not moving for 5 minutes.

afk_display.self_now_afk

  • Default - <yellow>You are now AFK.

afk_display.self_not_afk

  • Default - <yellow>You are no longer AFK.

afk_display.other_now_afk

  • Default - <gold><player><yellow> is now AFK.
  • Placeholders
    • player - The player who is now AFK

afk_display.other_not_afk

  • Default - <gold><player><yellow> is no longer AFK.
  • Placeholders
    • player - The player who is no longer AFK

Events

AFKStatusChangeEvent

  • Called when the player goes AFK or is no longer AFK.
  • Methods:
    • isAFK(): boolean
      • true if the player is going AFK, false if the player is no longer AFK.

AFKKickEvent

  • Called when the player is kicked for being AFK
⚠️ **GitHub.com Fallback** ⚠️