PlayTime » 1.17 - 1.21.8 icon

PlayTime » 1.17 - 1.21.8 -----

Track players playtime, reward them for it, and easily see the top playtimes.




[​IMG]

Commands »

[​IMG]

Aliases:
pt, playertime, onlinetime, timeplayed, ot
Permission Description
Code (Text):
playtime.reload
Access to the reload sub-command.
Code (Text):
playtime.clearrewards
Access to the clearrewards sub-command.

Images »
[​IMG]
(/playtime)
[​IMG]
(/playtime top)
[​IMG]
(/playtime rewards)

[​IMG]

[​IMG]
(/playtime clearrewards (player))

PlaceholderAPI »
Placeholder Description
Code (Text):
%playtime_playtime%
Displays the total playtime of the player viewing the placeholder.
Code (Text):
%playtime_<name>_playtime%
Displays the total playtime of the specified player. Example:
Code (Text):
%playtime_Notch_playtime%
Code (Text):
%playtime_top_<spot>_name%
Displays the username at a top position (1–10).
Code (Text):
%playtime_top_<spot>_time%
Displays the total playtime at a top position (1–10).
Code (Text):
%playtime_playtime_weeks%
Total playtime in weeks (with label).
Code (Text):
%playtime_playtime_days%
Total playtime in days (with label).
Code (Text):
%playtime_playtime_hours%
Total playtime in hours (with label).
Code (Text):
%playtime_playtime_minutes%
Total playtime in minutes (with label).
Code (Text):
%playtime_playtime_weeks_no_label%
Total playtime in weeks (number only).
Code (Text):
%playtime_playtime_days_no_label%
Total playtime in days (number only).
Code (Text):
%playtime_playtime_hours_no_label%
Total playtime in hours (number only).
Code (Text):
%playtime_playtime_minutes_no_label%
Total playtime in minutes (number only).
— Session (overall) —
Code (Text):
%playtime_session%
Displays the player’s current session playtime (formatted).
Code (Text):
%playtime_session_hours%
Current session playtime in hours (with label).
Code (Text):
%playtime_session_minutes%
Current session playtime in minutes (with label).
Code (Text):
%playtime_session_hours_no_label%
Current session playtime in hours (number only).
Code (Text):
%playtime_session_minutes_no_label%
Current session playtime in minutes (number only).
— Daily (overall) —
Code (Text):
%playtime_daily%
Displays the player’s playtime for today (formatted).
Code (Text):
%playtime_daily_hours%
Today’s playtime in hours (with label).
Code (Text):
%playtime_daily_minutes%
Today’s playtime in minutes (with label).
Code (Text):
%playtime_daily_seconds%
Today’s playtime in seconds (with label).
Code (Text):
%playtime_daily_hours_no_label%
Today’s playtime in hours (number only).
Code (Text):
%playtime_daily_minutes_no_label%
Today’s playtime in minutes (number only).
Code (Text):
%playtime_daily_seconds_no_label%
Today’s playtime in seconds (number only).
— Daily (per reward key) —
Code (Text):
%playtime_daily_<key>_current%
Today’s current progress toward the daily reward (formatted).
Code (Text):
%playtime_daily_<key>_required%
Required time for the daily reward (formatted).
Code (Text):
%playtime_daily_<key>_remaining%
Remaining time to reach the daily reward (formatted).
Code (Text):
%playtime_daily_<key>_progress%
Displays progress as
Code (Text):
current / required
(formatted).
Code (Text):
%playtime_daily_<key>_progress_percent%
Displays percent progress (0–100%).
— Session (per reward key) —
Code (Text):
%playtime_session_<key>_current%
Current session progress toward the session reward (formatted).
Code (Text):
%playtime_session_<key>_required%
Required session time for the reward (formatted).
Code (Text):
%playtime_session_<key>_remaining%
Remaining session time to reach the reward (formatted).
Code (Text):
%playtime_session_<key>_progress%
Displays progress as
Code (Text):
current / required
(formatted).
Code (Text):
%playtime_session<key>_progress_percent%
Displays percent progress (0–100%).
— Unique (per reward key) —
Code (Text):
%playtime_unique_<key>_current%
Current total playtime toward the unique reward (formatted).
Code (Text):
%playtime_unique_<key>_required%
Required total playtime to unlock the unique reward (formatted).
Code (Text):
%playtime_unique_<key>_remaining%
Remaining time to the unique reward (formatted).
Code (Text):
%playtime_unique_<key>_progress%
Displays progress as
Code (Text):
current / required
(formatted).
Code (Text):
%playtime_unique_<key>_progress_percent%
Displays percent progress (0–100%).
— Constant (per reward key; progress toward next cycle) —
Code (Text):
%playtime_constant_<key>_current%
Current cycle progress (time since last constant reward; formatted).
Code (Text):
%playtime_constant_<key>_required%
Interval length for the constant reward (formatted).
Code (Text):
%playtime_constant_<key>_remaining%
Remaining time until the next constant reward (formatted).
Code (Text):
%playtime_constant_<key>_progress%
Displays cycle progress as
Code (Text):
current / required
(formatted).
Code (Text):
%playtime_constant_<key>_progress_percent%
Displays percent cycle progress (0–100%).
— Streaks (per streak key) —
Code (Text):
%playtime_streak_<key>_days%
Total days required to complete the streak.
Code (Text):
%playtime_streak_<key>_duration%
Required daily duration (pretty format, e.g. “1h”, “30m”).
Code (Text):
%playtime_streak_<key>_count%
Current consecutive days achieved toward the streak.
Code (Text):
%playtime_streak_<key>_progress%
Displays streak progress as
Code (Text):
days_played / days
.
Code (Text):
%playtime_streak_<key>_claimed_today%
Whether the streak reward was claimed for the most recent completed day (true/false).

Configurable files »
Code (Text):
# config.yml
settings:
  # Which time units to display in formatted playtime.
  # Valid units: day, hour, minute, second.
  # Comment out 'second' if you don't want seconds to appear.
  Time-Format-Units:
    - day
    - hour
    - minute
    - second # comment this out if you don't want seconds

  # What labels to use for each unit.
  # These strings are appended to the number of days, hours, etc.
  Time-Formats:
    Day: " day"
    Hour: " hour"
    Minute: " minute"
    Second: " second"

  # Whether to automatically append an "s" to the labels when plural (e.g., "2 days" instead of "2 day").
  Append-Formats-With-An-S: true

  Rewards-Cleared:
    # When an admin clears a player's rewards, should the player be informed in chat?
    Tell-Target-All-Their-PlayTime-Rewards-Were-Cleared: true

  Use-existing-playtime: true
  # Use the data found in the world file for the players data that provides a playtime for the player.
  # With this disabled, PlayTime uses its internal system that starts tracking upon the plugin being installed.

update-check:
  # Automatically check for plugin updates on SpigotMC.
  enabled: true

  # Permission required to see the update notification.
  permission: playtime.update

  # Message shown to admins when an update is available.
  # Placeholders: %latest% = latest version, %current% = your version.
  message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &fA new version, &b%latest%&f, is available. You're running &e%current%&f."
[/LEFT]
mysql:
  enabled: false
  host: localhost
  port: 3306
  database: playtime
  username: root
  password: password
  table: playtime_data

  use-ssl: false                      # Whether to use SSL for the connection (set true if your MySQL server requires it).
  allow-public-key-retrieval: true    # Allows retrieval of the public key needed for authentication (useful for some MySQL setups).

  auto-reconnect: true                # If true, automatically attempts to reconnect if the connection is lost.
  connect-timeout-ms: 8000            # Connection timeout in milliseconds (time to wait before failing a new connection attempt).
  socket-timeout-ms: 0                # Socket timeout in milliseconds (0 = no timeout, connection can hang indefinitely if server is unresponsive).

  tcp-keepalive: true                 # Enables TCP keepalive packets to help detect dead connections.
  keepalive-minutes: 5                # How often (in minutes) to send keepalive packets to keep the connection alive.

  reconnect-attempts: 3               # Number of times to retry reconnecting before giving up.
  reconnect-interval-ms: 2000         # Delay (in milliseconds) between reconnect attempts.
[LEFT]
guis:
  Top:
    # Title of the GUI that shows the top playtimes.
    Title: '&fᴛᴏᴘ &bᴘʟᴀʏᴛɪᴍᴇꜱ'

    # How many players to display in the Top Playtimes GUI.
    How-Many-Players-To-Display-In-The-GUI: 10

    # How to format each player's name line in the Top GUI.
    # Placeholders: %position% = rank number, %player% = player name.
    Players-Name: '&b#%position% &7» &b%player%'

    # How to format the playtime shown for each player in the Top GUI.
    # Placeholder: %playtime% = formatted playtime.
    Players-Playtime: '&7%playtime%'

  Rewards:
    # Title of the GUI that shows available and claimed rewards.
    Title: '&bᴘʟᴀʏᴛɪᴍᴇ &fʀᴇᴡᴀʀᴅꜱ'

Code (Text):
# messages.yml
prefix: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &f"

messages:
  playtime:
    self:
      - "%prefix%&fYou've played for &b%playtime%&f."
      - "%prefix%&fTimes Joined: &b%joins%"
      - "%prefix%&fFirst Joined: &b%date-joined%"
    other:
      - "%prefix%&b%player% &fhas played for &b%playtime%&f."
      - "%prefix%&b%player% &fjoined &b%joins% &ftimes."
      - "%prefix%&b%player% &ffirst joined on &b%date-joined%&f."
    not-found:
      - "%prefix%&cNo &fplaytime data found for &b%target%&f."
  reloaded: "%prefix%&aConfiguration reloaded."
  top-header: "%prefix%Opening top playtimes..."
  no-permission: "%prefix%&cYou do not have permission to do that."
  player-only: "%prefix%&cOnly players can run this command."
  invalid-player: "%prefix%&cPlayer not found."
  invalid-usage: "%prefix%&cInvalid usage."
  rewards-were-cleared: "%prefix%Your playtime reward data has been &creset&f." # in the config.yml, the setting: "Tell-Target-All-Their-PlayTime-Rewards-Were-Cleared" must be set to "true" for the target to receive this message.
  cleared-players-rewards: "%prefix%All reward data for &b%player% &fhas been &ccleared&f."
  player-not-on-the-confirm-list: "%prefix%That players' PlayTime rewards aren't pending clear. &7(&e/pt clearrewards %player%&7)"
  constant-rewards-cant-be-cleared: "%prefix%&bConstant &frewards can't be reset. The rewards are intended to always be able to be redone."
  per-session-rewards-were-cleared: "%prefix%&6Per-session &frewards were &ccleared &ffor &b%player%&f."
  unique-rewards-were-cleared: "%prefix%&aUnique &frewards were &ccleared &ffor &b%player%&f."
  invalid-reward-type: "%prefix%&cInvalid &freward type. Use: &aunique &for &6per-session"
  players-data-already-in-confirm-list: "%prefix%The reward data for &b%player% &fis already pending confirmation. &7(&e/pt clearrewards %player% confirm&7)"
  hover-message:
    message-in-chat: "%prefix%You need to confirm clearing &lALL &fof &b%player%s' &freward data. &7(&a&lClick to confirm&7)"
    hover: "&fClick to confirm clearing of &b%player%s' &freward data."
  clear-rewards-breakdown:
  - "%prefix%Usage: &e/pt clearrewards (player) [reward-type]"
  - "                     &7(required) [optional]"
  - ""
  - "&fValid reward types: &aunique &f& &6per-session"
  help:
  - "%prefix%&e/playtime &7- &fView your playtime."
  - "%prefix%&e/playtime (player) &7- &fView another player's playtime."
  - "%prefix%&e/playtime rewards &7- &fView rewards for playtime milestones."
  - "%prefix%&e/playtime clearrewards (player) [reward-type] &7- &fClear all or a specified type of reward data for a player."
  - "%prefix%&e/playtime top &7- &fView top playtimes."
  - "%prefix%&e/playtime reload &7- &fReload plugin configuration.

Code (Text):
# rewards.yml
# Constant rewards repeat every X seconds of TOTAL playtime.
# Each reward entry requires:
#   interval: seconds (integer)
#   commands: commands to run (use %player% as placeholder)
#   message: (optional) message to send to the player
constant:
  two_hours:
    material: DIAMOND
    name: "&b%interval%"
    lore:
      - "&7Earn a reward every &b%interval%&7."
      - ""
      - "&fProgress: &b%progress%"
      - ""
      - "&fReward: &a%reward%"
      - "&fType: &bConstant"
    interval: 7200 # 2 hours
    commands:
      - "eco give %player% 100"
    message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &fYou received &a$100 &ffor reaching 2 hours played!"
    gui-interval: "2 hours"
    reward-desc: "$100"
    permissions-required: []

# Unique rewards are given ONCE when total playtime reaches the threshold.
unique:
  two_days:
    material: EMERALD
    name: "&a%interval%"
    lore:
      - "&7Earn a special reward for"
      - "&7hitting a specific milestone."
      - ""
      - "&fProgress: &b%progress%"
      - ""
      - "&fReward: &a%reward%"
      - "&fType: &aUnique"
    achieved:
      material: LIME_WOOL
      name: "&aAchieved - %interval%"
      lore:
        - "&7You've already achieved this reward."
        - ""
        - "&fReward: &a%reward%"
        - "&fType: &aUnique"
    at: 172800  # 48 hours
    commands:
      - "give %player% diamond 5"
    message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &b2 day &fmilestone reached! Enjoy &b5 diamonds&f."
    gui-interval: "2 days"
    reward-desc: "5x diamonds"
    permissions-required:
      - playtime.rewards.unique1
      - playtime.rewards.rank1

# Session rewards can be earned by a player being logged in
# in one session, without logging out of the server, for the
# set amount of required time for the reward to be given.
session:
  stay_30m:
    material: IRON_INGOT
    name: "&a%interval%"
    lore:
      - "&7Earn a reward for staying online"
      - "&7for a certain amount of time"
      - "&7without logging out."
      - ""
      - "&fProgress: &b%progress%"
      - ""
      - "&fReward: &a%reward%"
      - "&fType: &6Session"
    achieved:
      material: LIME_WOOL
      name: "&aAchieved - %interval%"
      lore:
        - "&7You've already achieved this reward."
        - ""
        - "&fReward: &a%reward%"
        - "&fType: &6Session"
    at: 1800  # 30 minutes in a single session (without logging out)
    commands:
      - "eco give %player% 100"
    message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ Thanks for staying online &b30 minutes &fstraight!"
    gui-interval: "30 minutes"
    reward-desc: "$100"
    permissions-required:
      - playtime.rewards.session1
      - playtime.rewards.rank1

# Daily rewards can be earned once per calendar day
# when the player's playtime for that day reaches the interval.
daily:
  half_hour:
    material: GOLD_INGOT
    name: "&6%interval%"
    lore:
      - "&7Come back every day and"
      - "&7play for at least &b%interval%&7!"
      - ""
      - "&fProgress: &b%progress%"
      - ""
      - "&fReward: &a%reward%"
      - "&fType: &eDaily"
    achieved:
      material: LIME_WOOL
      name: "&aAchieved - %interval%"
      lore:
        - "&7You've already achieved this reward."
        - ""
        - "&fReward: &a%reward%"
        - "&fType: &eDaily"
    interval: 900 # 15 minutes a day
    commands:
      - "crate key give %player% daily 1"
    message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &fThank you for playing for &b15 minutes &ftoday! — Here’s a Daily key!"
    gui-interval: "15 minutes"
    reward-desc: "1x Daily Key"
    permissions-required:
      - playtime.rewards.daily1
      - playtime.rewards.rank1

# Streaks require players to play a specified amount
# of time, for a specified amount of days.
streaks:
  example1:
    material: TRIPWIRE_HOOK
    name: "&b%duration%/day &7for &b%days%d"
    lore:
      - "&7Come back every day and"
      - "&7play for at least &b%duration%"
      - "&7for &b%days%d &7in a row!"
      - ""
      - "&fProgress: &b%progress%"
      - ""
      - "&fReward: &a%reward%"
      - "&fType: &cStreak"
    achieved:
      material: LIME_WOOL
      name: "&aAchieved - &6%duration%/day &7x &6%days%d"
      lore:
        - "&7You've already completed this streak."
        - "&7Progress: &a%days_played%&7/&a%days%"
        - "&fReward: &a%reward%"
    # Core streak settings
    Duration: 60        # minutes required per day
    Days: 7             # consecutive days to complete
    Reset-On-Claim: true    # if the streak data is reset automatically to have the player restart this streak
    reward-desc: "$1000 & 1x Diamond"
    commands:
      - "eco give %player% 1000"
      - "give %player% DIAMOND 1"
    message: "&bᴘʟᴀʏᴛɪᴍᴇ &e♦ &fStreak '&bexample1&f' completed! +$1000 & a diamond"
    permissions-required:
      - PlayTime.streaks.example1
Custom OP-Prison server:
Play.TheIslandsNetwork.com
(1.20.4 recommended)​
Support »
The quickest way to get support for any of my resources
would be to join my Resource Discord.
» https://discord.gg/2vUqykD

Note »
Please DO NOT leave bad reviews for any issues
that you have. Please simply PM me or leave it
in the discussion tab. Thank you. (y)

That and reviews are highly appreciated! :alien:

[​IMG]
Resource Information
Author:
----------
Total Downloads: 10,573
First Release: Jul 31, 2017
Last Update: Yesterday at 10:16 PM
Category: ---------------
All-Time Rating:
12 ratings
Find more info at discord.gg...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings