PlayTimes - Track Player PlayTime icon

PlayTimes - Track Player PlayTime -----

The best /playtime plugin! PAPI support, offline checks, API & more!





More information can be found here:
wiki

[​IMG]
Playtime has many custom placeholders!
Code (Text):
%player% - Get player's name.
%rawtime% - Get player's raw playtime.
%afktime% - Get player's afk time.
%playtime% - Get player's playtime (rawtime minus afktime).
%timesjoined% - Get # of times player joined.
%joindate% - Gets the date which the player has joined.
%place% - Gets place in top leaderboard (only for /toppt)
%player% - Gets player name (only for /toppt)
%timeleft% - Gets time left in cooldown for /toppt

Database:
%rawtime_serverId% - The total time spent on the server.
%afktime_serverId% - The time spent AFK (Away From Keyboard) on the server.
%playtime_serverId% - The active playtime on the server (rawtime minus afktime, if afk is enabled).
%global_playtime% - The total playtime from all servers.
%global_rawtime% - The total rawtime from all servers.
%global_afktime% - The total afktime from all servers.

 


How to use placeholders from PlayTime in other plugins:
You must have this plugin downloaded and inside your plugins folder.
The plugin automatically registers the placeholders.
Placeholders:
)
Code (Text):
%PlayTimes_playtime% - returns player's playtime
%PlayTimes_uptime%    - returns server uptime
%PlayTimes_joindate%  - returns players joindate
%PlayTimes_timesjoined%  - returns how many times the player joined

Leaderboard placeholders:
%PlayTimes_topname1% - returns the #1 player with the most playtime (returns their name)
%PlayTimes_toptime1% - returns the #1 time (player #1's time)

You can go from 1 - 10 with this!
Example) If you want the 3rd top playtime name and time do:
%PlayTimes_topname3%  and %PlayTimes_toptime3%

Complete list:
%PlayTimes_topname1%
%PlayTimes_topname2%
%PlayTimes_topname3%
%PlayTimes_topname4%
%PlayTimes_topname5%
%PlayTimes_topname6%
%PlayTimes_topname7%
%PlayTimes_topname8%
%PlayTimes_topname9%
%PlayTimes_topname10%

%PlayTimes_toptime1%
%PlayTimes_toptime2%
%PlayTimes_toptime3%
%PlayTimes_toptime4%
%PlayTimes_toptime5%
%PlayTimes_toptime6%
%PlayTimes_toptime7%
%PlayTimes_toptime8%
%PlayTimes_toptime9%
%PlayTimes_toptime10%
You will only be able to use these placeholders in other plugins if they support PAPI!

Want more placeholders?


Feel free to dm me to request some to be added or check out the spolier below to learn how to use placeholders from other plugins in PlayTimes:
How to use placeholders from PlaceHoldersAPI:
1. Download placeholderapi

2. Download the placeholders, /papi ecloud download <name>
3. Reload papi, /papi reload
4. Make sure to have use-papi-placeholders: true in the config.yml!
5. Reload PlayTimes
6. Use the placeholders in PlayTime!


[​IMG]
Commands:
Code (Text):
/playtime
/playtime <player>
/playtime block <player> - blocks player from being on the leaderboards
/playtime unblock<player> - unblocks player from leaderboards
/playtime top - /toppt shortcut
/playtime help - admin command to show command usage
/playtime version - admin command for bug reporting
/uptime
/playtime reload
/topplaytime
Playtime aliases: /playerinfo, /playt, /pt
Uptime aliases: /serveruptime, /serverupt
TopPlayTime aliases: /toppt

NOTE: /pte was removed, may return soon.

Permissions:
Code (Text):
pt.use - Lets you use /playtime.
pt.others - Lets you check others playtime.
pt.uptime - Lets you check server uptime.
pt.reload - Lets you reload & more.
pt.block - Lets you block players from being on the leaderboard
pt.top - Lets you use /toppt
pt.block-cooldown - No cooldown for /toppt


[​IMG]

[​IMG]
[​IMG]
Code (YAML):
# PlayTimes by CodedRed
# For assistance, please submit inquiries here: https://github.com/CodedRed-Spigot/PlayTimes/issues

# The 'prefix' configures the introductory text for 'player-not-found' and 'player-never-joined' notifications.
prefix
: "&7[&b&lPlayTimes&7]"

# Placeholder API Configuration
# Activate this only if using PlaceholderAPI with PlayTimes.
# To integrate PlayTimes placeholders into other plugins, simply install PlaceholderAPI; integration occurs seamlessly.
use-papi-placeholders
: false

# PlayTimes Formatting and Message Customization
# 'playtime.name' defines time unit labels. For formatting guidance, refer to our Spigot plugin page.
playtime
:
  ## Default Placeholders:
  ## %player%, %playtime%, %timesjoined%, %joindate%, %rawTime%, %afkTime%
  ## For database placeholders, visit: https://github.com/CodedRed-Spigot/PlayTimes/wiki/Bungee-Support
  ## PlaceholderAPI placeholders are also compatible.
  message
:
   - "&b&m=======&b&l[%player%]&b&m======="
    - "&aPlaytime:&f %playtime%"
    - "&aTimes Joined:&f %timesjoined%"
    - "&aJoin Date:&f %joindate%"
    - "&b&m============================"
  name
:
    second
: "s"
    minute
: "min "
    hour
: "hr "
    day
: "day "
    seconds
: "s"
    minutes
: "mins "
    hours
: "hrs "
    days
: "days "

  ## 'only-hours' - Displays playtime solely in hours. Activating this overrides 'show-seconds' and 'show-days'.
  ## 'show-seconds' - Includes seconds in the display.
  ## 'show-days' - Includes days in the display.
  only-hours
: false
  show-seconds
: true
  show-days
: true
  ## 'round-numbers' - Rounds off the playtime to whole numbers when 'only-hours' is true.
  round-numbers
: true

# AFK Tracker Configuration
# NOTE: When enabled, this will remove afk time from %time% placeholder
afk-settings
:
  enabled
: true

  ## Time in minutes after which a player is considered AFK.
  threshold
: 5

  ## Notifications settings for AFK status changes.
  broadcast-afk
:
    on-enter-afk
: true
    on-exit-afk
: true

  # Message to send to the player when they are marked as AFK.
  on-enter-afk-message
: "&eYou are now marked as AFK."
  # Message to send to the player when they are no longer marked as AFK.
  on-exit-afk-message
: "&eYou are no longer AFK."
  # Leave true unless you are experiencing lag/issues with one of the afk listeners.
  cancel-afk
:
    on-player-move
: true
    on-player-chat
: true
    on-player-interact
: true

# /Uptime Command Configuration - Use '%serveruptime%' to display server uptime.
uptime
:
  message
:
   - "&b&m============================"
    - "&aServer Uptime:&f %serveruptime%"
    - "&b&m============================"

# /toppt Command Settings
## Standard Placeholders:
## %player%, %place%, %time%, %joindate%
## PlaceholderAPI placeholders are also supported.
top-playtime
:
  header
: "&b******&9[&3&lPlayTime Leaderboards&9]&b*****"
  content
: "&5%place%) &9&l%player% &9&o- %time%"
  footer
: "&b****************************************"
  enable-cooldown
: true
  cooldown-seconds
: 60
  track-rawtime
: false

# 'date-format' - Customize this to change the format of join dates.
# Explore more formatting options at: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
date-format
: "MM/dd/yyyy"

# Customizable Built-In Messages
messages
:
  noPermission
: "&cYou cannot run this command."
  player-not-found
: "&cUnable to locate player."
  player-never-joined
: "&cThis player has not joined the server."
  cooldown
: "&cCommand unavailable for %timeleft% seconds!"

# Do not change this unless you know what you're doing!
# This setting is for servers experiencing issues when looking up offline players.
# For more information, see the link below.
uuid-lookups
:
  what-does-this-do
: https://github.com/CodedRed-Spigot/PlayTimes/wiki/UUID-LOOKUPS
  type
: "default"
 
Code (Text):
database-settings:
  enabled: false
  type: "mysql" # change to 'sqlite' for SQLite
  database: "playtimes"
  host: "localhost"
  port: 3306
  user: "root"
  password: "password"
  useSSL: false
  # IMPORTANT:
  # 'serverId' must be UNIQUE to each server!
  # If you have multiple servers running PlayTimes, ensure each config has a unique 'serverId'.
  # The 'serverId' will also be used for placeholders, like %playtime_serverId% (e.g., %playtime_survival%).
  # The placeholder will return the playtime on that specific server.
  serverId: "survival"

# If enabled, upon starting your server it will purge all user info that is older than x months.
# NOTE: This will only purge data for the specific 'serverId', not for all servers!
purge-database:
  enabled: false
  months: 12
# Placeholders:
## For use in Plugin:
# %rawtime_serverId%
# %afktime_serverId%
# %playtime_serverId%
## For PAPI:
# %PlayTimes_rawtime_serverId%
# %PlayTimes_afktime_serverId%
# %PlayTimes_playtime_serverId%
 

For Hex Color codes use <#123456> format!



[​IMG]
JSON tellraw text lets you make custom chat messages that could include hoverable text, suggest command, link, colors, styles, and more!
For help with JSON chat check out the link below!
JSON Wiki Help


REMEMBER! When writing this info into the config file you must add a backward slash(\) before the quotes. Example below:
Code (Text):
   - " {\"text\":\"Website\",\"bold\":true,\"color\":\"green\",\"clickEvent\":{\"action\":\"open_url\",\"value\":\"http://google.com\"},\"hoverEvent\":{\"action\":\"show_text\",\"value\":\"Visit our Website!\"}}"


[​IMG]
The API for this plugin has been greatly redone. First, start off by adding this resource to your plugin.

**BIG API Changes are on the way.**(Check out update 1.4)
Once this plugin is added to your projects' external libraries you can start to use it!

The API works from two different methods.

A TimelessPlayer and a TimelessServer.


TimelessPlayer:

A TimelessPlayer can either be online or offline.
Example: Creating an online player:
Code (Java):
TimelessPlayer player = new TimelessPlayer (event. getPlayer ( ) ) ;
*If the player is offline or unknown use a UUID instead of a Player!
Example: Creating an offline player:
Code (Java):
TimelessPlayer player = new TimelessPlayer (uuid ) ;
A Timeless player has the following methods:

Code (Text):
getPlayTime() - returns playtime of player in format
 

TimelessServer:

A TimelessServer can display the top 10 leaderboard info and uptime!

To create a TimelessServer simply do:
Code (Java):
TimelessServer server = new TimelessServer ( ) ;
The methods a TimelessServer can do are:

Code (Text):
getTop10Players() - returns top 10 players in a list
getNumberOne() - returns number 1 in leaderboard
getNumberTwo() - returns number 2
getNumberThree()... all the way to getNumberTen()

getUptime() - returns server uptime in format
getUptimeInSeconds() - returns uptime in seconds
NOTE: It is recommended to use getTop10Players() and retrieving the other positions when dealing with multiple positions.


For further help join the help discord :)
P.S old API works but will be removed in 2-3 updates!



[​IMG]
(NOTE: You will only need to do this in old versions of MC)
https://github.com/CodedRed-Spigot/PlayTimes/wiki/Legacy-MC-Version-Help

How to update player time faster:
If the players playtime isn't updating every second you will have to go into your bukkit.yml folder on your server and change ticks-per: autosave: to 20.
NOTE: This may cause more lag, recommend to keep at default or close to it!
Code (Text):
ticks-per:
  animal-spawns: 400
  monster-spawns: 1
  autosave: 20



[​IMG]

If you are experiencing an issue go here!
Need help? First, check out the wiki!


NOTE:
Your world folder *must* contain a stats folder for PlayTimes to work. PlayTimes does not record your player time but rather displays the data from the world's stat folder. If you do not have a Stats folder check your spigot.yml and make sure the "stats" section has "disable-saving" as false!​
Resource Information
Author:
----------
Total Downloads: 36,945
First Release: Jul 17, 2018
Last Update: Jun 20, 2024
Category: ---------------
All-Time Rating:
79 ratings
Find more info at github.com...
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings