Skip to content

Playtime related placeholders

TheGaBr0 edited this page Sep 5, 2026 · 7 revisions

Here's the updated markdown. The new placeholders are the onlinefor / afkfor family (added in 3.6.6) — current session length and current continuous-AFK-streak length, with per-unit and per-nickname variants.

Go back to Placeholders index

Placeholders

Current player

Placeholder Description Details
%PTM_playtime% Displays the current player's total playtime Playtime format can be customized
%PTM_afk_playtime% Displays the current player's AFK playtime Playtime format can be customized
%PTM_playtime_#% Displays the current player's total playtime converted to a specific time unit Replace # with one of the available time units
%PTM_afk_playtime_#% Displays the current player's AFK playtime converted to a specific time unit Replace # with one of the available time units
%PTM_onlinefor% Displays how long the current player has been online in their current session Playtime format can be customized
%PTM_onlinefor_#% Displays the current player's current session length converted to a specific time unit Replace # with one of the available time units
%PTM_afkfor% Displays how long the current player has been continuously AFK in their current AFK streak Playtime format can be customized. Returns 0 (or its formatted equivalent) if the player isn't currently AFK
%PTM_afkfor_#% Displays the current player's current AFK streak length converted to a specific time unit Replace # with one of the available time units

Specific player

Placeholder Description Details
%PTM_playtime_<nickname>% Displays the total playtime for a specific player Playtime format can be customized
%PTM_afk_playtime_<nickname>% Displays the AFK playtime for a specific player Playtime format can be customized
%PTM_playtime_#_<nickname>% Displays the total playtime for a specific player converted to a specific time unit Replace # with one of the available time units
%PTM_afk_playtime_#_<nickname>% Displays the AFK playtime for a specific player converted to a specific time unit Replace # with one of the available time units
%PTM_onlinefor_<nickname>% Displays the current session length for a specific player Playtime format can be customized. Returns 0 if the player is offline
%PTM_onlinefor_#_<nickname>% Displays the current session length for a specific player converted to a specific time unit Replace # with one of the available time units
%PTM_afkfor_<nickname>% Displays the current continuous AFK streak length for a specific player Playtime format can be customized. Returns 0 if the player isn't currently AFK or is offline
%PTM_afkfor_#_<nickname>% Displays the current continuous AFK streak length for a specific player converted to a specific time unit Replace # with one of the available time units

AFK time calculations

If the ignore-afk-time configuration option is set to true, AFK time will be excluded from total playtime calculations. This affects the following placeholders:

  • %PTM_playtime%
  • %PTM_playtime_#%
  • %PTM_playtime_<nickname>%
  • %PTM_playtime_#_<nickname>%
  • %PTM_playtime_top_<rank>%
  • %PTM_playtime_top_#_<rank>%

Error messages

Error messages are disabled by default. To enable them, set enable-errors to true under the placeholders field in config.yaml.


"Error: couldn't get playtime"

Cause: An exception was thrown while retrieving the current online player's playtime. This typically means the player's session is null at evaluation time.

Steps to check:

  • This should not occur for a player who is actively online. If it persists, check for session management errors in the server logs and contact me on discord.

"Error: couldn't get AFK playtime"

Cause: An exception was thrown while retrieving the current online player's AFK playtime. This typically means the player's session is null at evaluation time.

Steps to check:

  • This should not occur for a player who is actively online. If it persists, check for session management errors in the server logs and contact me on discord.

"Error: couldn't get online time"

Cause: An exception was thrown while retrieving the current online player's session length (%PTM_onlinefor% and its variants). This typically means the player's session is null at evaluation time.

Steps to check:

  • This should not occur for a player who is actively online. If it persists, check for session management errors in the server logs and contact me on discord.

"Error: couldn't get afk time"

Cause: An exception was thrown while retrieving the current online player's AFK streak length (%PTM_afkfor% and its variants). This typically means the player's session is null at evaluation time.

Steps to check:

  • This should not occur for a player who is actively online. If it persists, check for session management errors in the server logs and contact me on discord.

"Error: Player not found in db"

Cause: No record matching the provided nickname exists in the database.

Steps to check:

  • Double-check the spelling and casing of the nickname — it must match exactly as stored.
  • Confirm the player has joined the server at least once. Players who have never connected have no database record.

"Loading..."

Cause: The plugin found the player's UUID but their data has not yet been fully loaded from the database. This is a transient state that occurs briefly after a player joins.

Steps to check:

  • This resolves automatically within a second or two. No action required under normal conditions.
  • If the message persists, check for database connection issues or thread pool exhaustion in the se

Clone this wiki locally