PlayTimes - Check players playtime & Server Uptime 1.4.5

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

  1. CodedRed
    Native Minecraft Version:
    1.16
    Tested Minecraft Versions:
    • 1.7
    • 1.8
    • 1.9
    • 1.10
    • 1.11
    • 1.12
    • 1.13
    • 1.14
    • 1.15
    • 1.16
    • 1.17
    Source Code:
    https://github.com/CodedRed-Spigot/PlayTimes
    [​IMG]


    [​IMG]
    PlayTimes is the perfect plugin for your server! Have players show off and compete for more time played with playtime's leaderboards! Not only can you check online/offline players playtime you can also check the uptime of the server! There is a lot coming to playtime such as PlayTime Rewards, PlayTime Ranks & PlayTime Shop!


    [​IMG]
    Playtime is great for players to check their playtime and more! Check your server uptime as well as use PAPI to check more important info!

    ⋯ Custom messages!
    ⋯ Check total time played on server!
    ⋯ Check offline players online playtime!
    ⋯ Check server uptime!
    PAPI support
    ⋯ Use JSON text!
    ⋯ Offline Server Support
    ⋯ Easy to config
    ⋯ Get players join date!
    ⋯ Check the top 10 players playtime! /toppt
    ⋯ Cooldown for /toppt
    ⋯ API
    ⋯ HEX Support

    [​IMG]
    Playtime has many custom placeholders!
    Code (Text):
    %player% - Get player's name.
    %time% - Get player's playtime.
    %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
     


    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

    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
    /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 support please ask here: https://discord.gg/7A9UA2n

    # Prefix will show before 'player-not-found' & 'player-never-joined' messages
    prefix
    : "&7[&b&lPlayTimes&7]"

    # date-format can be changed to your liking.
    # For more placeholders look here: https://docs.oracle.com/javase/8/docs/api/java/text/SimpleDateFormat.html
    # This is the join date format.
    date-format
    : MM/dd/yyyy

    # Placeholders API info
      # Only enable this if you are using PAPI holders in PlayTimes
      # If you want to use PlayTimes placeholders in other plugins...
      # Just download PAPI and it will *automatically* register
    use-papi-placeholders
    : false

    # Main Playtimes info.
    # The name refers to the format. Example if you have minute = " min" then it will display "x min"
    playtime
    :
      name
    :
        second
    : "s"
        minute
    : "min"
        hour
    : "hr"
        day
    : "day"
        seconds
    : "s"
        minutes
    : "mins"
        hours
    : "hrs"
        days
    : "days"

      ## only-hours - when true it will display playtime in hours (When true this will also disable show-seconds/days setting)
      ## show-seconds - when true it will display seconds
      ## show-days - when true it will display days
      only-hours
    : false
      show-seconds
    : true
      show-days
    : true


      ## Built-in Placeholders:
      ## %player% %time% %timesjoined% %joindate%
      ## You may also use PAPI Placeholders
      message
    :
       - "&b&m=======&b&l[%player%]&b&m======="
        - "&aPlaytime:&f %time%"
        - "&aTimes joined:&f %timesjoined%"
        - "&aJoined Date:&f %joindate%"
        - "&b&m============================"

    # /Uptime command info - only placeholder is %serveruptime%
    uptime
    :
      message
    :
       - "&b&m============================"
        - "&aServer Uptime:&f %serveruptime%"
        - "&b&m============================"

    # /toppt command info
    ## Built-in Placeholders:
    ## %player% %place% %time% %joindate%
    ## You may also use PAPI placeholders
    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

    # Built in messages, may change to your liking :D
    messages
    :
      noPermission
    : "&cYou cannot run this command."
      player-not-found
    : "&cPlayer not found."
      player-never-joined
    : "&cPlayer has never joined the server!"
      cooldown
    : "&cYou cannot use this command for %timeleft% seconds!"
     

    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)
    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


    (located in bukkit.yml folder)
    [​IMG]


    [​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!

    Stats for PlayTimes is located here: https://bstats.org/plugin/bukkit/PlayTimes/5289


    [​IMG]
    [​IMG] [​IMG]
    The plugin doesn't work the way you want it to? Message me through discord, spigot, or on the discussion page before you leave a review. Leaving a review with error messages does not make me work any harder to solve the issue.​

    belisarius, Pekay, KaiRenXVN and 5 others like this.

Recent Updates

  1. Update 1.4.5
  2. Timings Fix
  3. Bug Fixes & New Threading

Recent Reviews

  1. Ghostaunt.TV
    Ghostaunt.TV
    4/5,
    Version: 1.4.4
    1. CodedRed
      Author's Response
      Looks like an error with something you inputted into the config.yml. Please dm me for further help!
  2. LukeAtomic
    LukeAtomic
    5/5,
    Version: 1.4.4
    This plugin is great!, everything works brilliant, placeholders actually works, for some reason some other plugins they dont work. So im very happy they work. 100% recommend using this plugin.
  3. Mythologyli
    Mythologyli
    5/5,
    Version: 1.3.10
    Thanks for your great work!
    In spigot 1.17, when I used the toppt command, I got this error:

    Unexpected exception while parsing console command "toppt"
    >org.bukkit.command.CommandException: Unhandled exception executing command 'toppt' in plugin Playtimes v1.3.10
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:764) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchServerCommand(CraftServer.java:749) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at net.minecraft.server.dedicated.DedicatedServer.handleCommandQueue(DedicatedServer.java:473) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at net.minecraft.server.dedicated.DedicatedServer.b(DedicatedServer.java:437) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:1199) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at net.minecraft.server.MinecraftServer.x(MinecraftServer.java:1026) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at net.minecraft.server.MinecraftServer.lambda$0(MinecraftServer.java:307) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    at java.lang.Thread.run(Thread.java:831) [?:?]
    >Caused by: java.lang.NullPointerException: Cannot invoke "java.lang.Long.longValue()" because the return value of "org.json.simple.JSONObject.get(Object)" is null
    at me.codedred.playtimes.utils.Statistics.getPlayerStatistic(Statistics.java:35) ~[?:?]
    at me.codedred.playtimes.models.Leaderboard.updateTimes(Leaderboard.java:69) ~[?:?]
    at me.codedred.playtimes.models.Leaderboard.getTopTen(Leaderboard.java:59) ~[?:?]
    at me.codedred.playtimes.commands.TopTime.onCommand(TopTime.java:43) ~[?:?]
    at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45) ~[spigot.jar:3118-Spigot-66f9d3c-27835bd]
    ... 9 more
    1. CodedRed
      Author's Response
      Thanks for the review! Plugin has been updated to 1.17, this error should be gone for you now :)
  4. 2580crq
    2580crq
    5/5,
    Version: 1.3.10
    The following prompt appears:
    [08:01:28 WARN]: Initializing Legacy Material Support. Unless you have legacy plugins and/or data this is a bug!
    [08:01:34 WARN]: Legacy plugin Playtimes v1.3.10 does not specify an api-version.
    1. CodedRed
      Author's Response
      Do not worry about this warning, I will look to change it soon. Thank you for the review!
  5. fabsi2aYT
    fabsi2aYT
    5/5,
    Version: 1.3.10
    Very Cool, but can you add Mysql support? I need it for my Server. You could also add to change the reflesh in ticks for the playtime in the config.
    1. CodedRed
      Author's Response
      Thanks for the review, MySQL support is coming. PlayTimes does not count time at all, the time is counted by the server. To configure the refresh time you must change your autosave time.
  6. NylaOnYoutube
    NylaOnYoutube
    5/5,
    Version: 1.3.10
    Nice plugin, but can you add placeholders in sek, hours, min?
    would be really better.
    1. CodedRed
      Author's Response
      The placeholder system is being looked into, check out the current PAPI placeholders for a bit more configurability. Thank you!
  7. FireRoz
    FireRoz
    5/5,
    Version: 1.3.10
    Would love to see support for GUIs.
    Example:
    A red wool would be how many times the player has logged on, the lore would be the value. (Total logins: 1000)
    1. CodedRed
      Author's Response
      Thanks for the review!
      I looked into adding a GUI before, maybe I'll take another look into adding one. Thanks again!
  8. BandaiBoys
    BandaiBoys
    5/5,
    Version: 1.3.10
    Looks like a good plugin, however, does playtime freeze when you're afk? (Like the essentials plugin)
    1. CodedRed
      Author's Response
      No PlayTimes only reads the time-played (time online). I suggest getting a good afk kicker or waiting for my premium version of PlayTimes coming soon.
  9. 1HarryH
    1HarryH
    5/5,
    Version: 1.3.10
    It works on 1.16.4 Paper :) very nice and easy configurable Plugin :)
    Top work !
    1. CodedRed
      Author's Response
      Appreciate the review! Thank you.
  10. ZamanPvpNetwork
    ZamanPvpNetwork
    3/5,
    Version: 1.3.8
    [07:55:49 INFO]: Loaded plugin cmd_list version git:cmd_list:1.16-R0.4-SNAPSHOT:52a5c6f:371 by WaterfallMC
    [07:55:49 WARN]: Error enabling plugin Playtimes
    java.lang.NoClassDefFoundError: org/bukkit/plugin/java/JavaPlugin
    at java.lang.ClassLoader.defineClass1(Native Method) ~[?:1.8.0_211]
    at java.lang.ClassLoader.defineClass(Unknown Source) ~[?:1.8.0_211]
    at java.security.SecureClassLoader.defineClass(Unknown Source) ~[?:1.8.0_211]
    at java.net.URLClassLoader.defineClass(Unknown Source) ~[?:1.8.0_211]
    at java.net.URLClassLoader.access$100(Unknown Source) ~[?:1.8.0_211]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_211]
    at java.net.URLClassLoader$1.run(Unknown Source) ~[?:1.8.0_211]
    at java.security.AccessController.doPrivileged(Native Method) ~[?:1.8.0_211]
    at java.net.URLClassLoader.findClass(Unknown Source) ~[?:1.8.0_211]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:44) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:37) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]
    at net.md_5.bungee.api.plugin.PluginManager.enablePlugin(PluginManager.java:381) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.api.plugin.PluginManager.loadPlugins(PluginManager.java:285) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.BungeeCord.start(BungeeCord.java:277) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.BungeeCordLauncher.main(BungeeCordLauncher.java:62) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.Bootstrap.main(Bootstrap.java:15) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    Caused by: java.lang.ClassNotFoundException: org.bukkit.plugin.java.JavaPlugin
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass0(PluginClassloader.java:63) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at net.md_5.bungee.api.plugin.PluginClassloader.loadClass(PluginClassloader.java:37) ~[Waterfall.jar:git:Waterfall-Bootstrap:1.16-R0.4-SNAPSHOT:52a5c6f:371]
    at java.lang.ClassLoader.loadClass(Unknown Source) ~[?:1.8.0_211]
    ... 18 more
    [07:55:49 INFO]: Enabled plugin reconnect_yaml version git:reconnect_yaml:1.16-R0.4-SNAPSHOT:52a5c6f:371 by WaterfallMC
    [07:55:49 INFO]: Enabled plugin cmd_find version git:cmd_find:1.16-R0.4-SNAPSHOT:52a5c6f:371 by WaterfallMC
    [07:55:49 INFO]: Enabled plugin SkinsRestorer version 13.4-SNAPSHOT by Th3Tr0LLeR, DoNotSpamPls, Blackfire62
    1. CodedRed
      Author's Response