Skip to content

Stats GUI

TheGaBr0 edited this page Aug 31, 2025 · 1 revision

📊 Player Stats GUI Tutorial

Welcome to the PlayTimeManager Player Stats GUI System! This guide walks you through configuring, customizing, and managing the player statistics interface to provide different experiences based on who's viewing the stats.

📘 What Is the Player Stats GUI?

The Player Stats GUI is a dynamic interface system that displays different information and layouts based on who is viewing the statistics. The same GUI can show personalized information for the owner, limited details for other players, and detailed data for staff members.

The system supports three distinct view types:

  • Owner View: Players viewing their own statistics
    • Used when a player executes /playtimestats
  • Player View: Players viewing another player's statistics
    • Used when a player executes /playtimestats <playername>
  • Staff View: Staff members viewing detailed player information
    • Used when a player with playtime.others.stats.staff permission executes /playtimestats <playername>

Each view can have completely different:

  • Titles and GUI sizes
  • Border materials and styling
  • Available items and information
  • Item positions and layouts

📁 Configuration Location

The player stats GUI is configured in the main configuration file under the Customizations/GUIs folder.


🔤 Available Placeholders

PAPI placeholders are supported and can be used in item names, lore, and GUI titles, furthermore the following internal placeholders can be used:

Category Placeholder Description
Player Data %PLAYER_NAME% Player's display name
%UUID% Player's unique identifier
Time Statistics %PLAYTIME% Total playtime (format can be customized)
%ACTUAL_PLAYTIME% Real playtime only (artificially added/removed playtime and afk playtime not counted)
%ARTIFICIAL_PLAYTIME% Artificially added/removed playtime
%AFK_PLAYTIME% AFK playtime
%FIRST_JOIN_DATE% When player first joined
%ACCOUNT_AGE% Time since first join
%LAST_SEEN_DATE% Last online timestamp
%TIME_SINCE_LAST_SEEN% Time since last online
Join Streaks %RELATIVE_STREAK% Relative streak counter.
Learn about different types of join streaks here
%ABSOLUTE_STREAK% Absolute streak counter
Learn about different types of join streaks here
Goals %GOALS_COUNT% Number of completed goals
%GOALS_LIST% Formatted list of completed goals
Playtime Leaderboard %POSITION% Player's leaderboard rank

Some placeholders include special settings:

goals-settings:
  # This setting controls how goals are formatted when using the %GOALS_LIST% placeholder
  list-format: "&7• &e%GOAL%"

leaderboard-settings:
  # Fallback message shown when %POSITION% placeholder is used for unranked players
  not-in-leaderboard-position: "-"

⚙️ GUI Configuration

🏷️ View-specific configurations

Each view has a set of specific attributes that you can customize. Here an example for the staff view:

  views:
    staff:
      title: "&c&l&6%PLAYER_NAME%'s stats"
      size: 54
      # Determines the number of slots in the inventory
      # Valid sizes: 9, 18, 27, 36, 45, 54 (rows × 9)
      border:
      # Controls whether a decorative border is displayed
      # true = border fills empty edge slots, false = no border
        enabled: true
        material: "RED_STAINED_GLASS_PANE"
        name: "&c&lP.T.M"

📋 Item Configuration

Each item represents a specific statistic area however, items can also be purely aesthetic for decoration or organization.

🔧 Item Structure

Items are configured per-view, allowing different appearances and data. You can create custom items by using names that don't already exist in the stats GUI configuration, which prevents naming conflicts. Follow this structure:

  • Use exactly 2 spaces for each indentation level (no tabs)
  • views: is mandatory for each item
  • Each view can only be owner, player, or staff - no other view types are allowed
  • Views are optional - you can include any combination (e.g., only staff and player, or just owner, etc...)
  • Fields (enabled, material, slot, etc..) are optional - if omitted, default values will be used instead
  items:
    playtime:
      views:
        owner:
          enabled: true
          material: "CLOCK"
          slot: 22
          name: "&e&lMy Playtime"
          lore:
            - "&7Total Time Played: &e%PLAYTIME%"
            - ""
            - "&8View: %VIEW_TYPE%"
        player:
          enabled: true
          material: "CLOCK"
          slot: 13 
          name: "&e&l%PLAYER_NAME%'s Playtime"
          lore:
            - "&7Playtime: &e%PLAYTIME%"
        staff:
          enabled: true
          material: "CLOCK"
          slot: 20
          name: "&e&lPlaytime Information"
          lore:
            - "&7Total Playtime: &e%PLAYTIME%"
            - "&7Actual Playtime: &a%ACTUAL_PLAYTIME%"
            - "&7Artificial Playtime: &c%ARTIFICIAL_PLAYTIME%"

Slots field:

If the slot field is omitted or the specified value is outside the maximum range, the item will simply be skipped and not included into the GUI. This field support 2 kind of inputs:

  • Single value:
    •   slot: 1
  • Multiple values:
    •   slot: [1, 2, 3]
      In this case the item will be cloned for each valid slot specified in the array.

PLAYER_HEAD material:

The PLAYER_HEAD material displays the skin of the statistics owner by default, but you can specify a particular player using PLAYER_HEAD:playername format (e.g., PLAYER_HEAD:Notch).

Keep in mind that player heads rely on Mojang's API which can occasionally be slow or unavailable, potentially causing heads to display as default Steve/Alex skins or generic player heads until the API responds. Player names are case-sensitive and should match exact Minecraft usernames, and since skins are typically cached by the server, recent skin changes may not appear immediately in the GUI.

✅ Enabling/Disabling Items

Instead of completely removing a view from an Item, you can just set the enabled field to false:

lastseen:
  views:
    owner:
      enabled: false  # Owner doesn't need to see their own "last seen"
    player:
      enabled: true   # Others can see when player was last online
    staff:
      enabled: true   # Staff can see all activity data

Clone this wiki locally