HomeJavaModsEnhanced PlayTime
Enhanced PlayTime
EnhancedPlayTimeLogo2.png
Hologram Board example (5 players per page, no exclude days) Page 1 & 2
EnhancedPlayTime-SS5.png
Hologram Board example (10 players per page, last played < 90 days excluded)
EnhancedBalTop-SS3.png
Text Board example via /playtime command
EnhancedBalTop-SS4.png

TESTED ON CraftBukkit/Spigot 1.8 - 1.12

PLEASE DON'T FORGET TO RATE THIS PLUGIN ! ;)

EnhancedPlayTime-Description.png
Fully customisable and enhanced /playtime text & holographic player play/afk time boards. (Uses Holographic Displays plugin).

Text & Holographic boards can be customised to show Top N (number) of players, play time, afk time page at a time.

User-definable format of these boards and page size (no. player info per page) can be defined, with a header, detail and footer format of your choice (config.yml).

Play Time and AFK times, player exclusion list, hologram info are stored in a SQLite 3 database (stored in playTimes.db in the plugin directory)

Players can be excluded from the text and holographic boards in a variety of ways:-

a) Via ExcludeDays : (set in config.yml)
Initial play/afk times for all offline players are loaded upon plugin start/enable. Those that last played over the number of days specified by ExcludeDays: will be excluded from ALL text/hologram boards

Set this to 0 to disable this, i.e. allow ALL players regardless of their last played date/time.

b) Via ExcludePermNode: (set in config.yml)
Add the permission node value defined by this key value in config.yml to any group or individual users permissions and it will be excluded upon plugin start/load.

c) Via /playtime exclude command (See Commands)
Add's player to permanent exclusion list that is stored permanently in SQLite database.


EnhancedPlayTime-Cmds-Perms.png
Just a quick side note, EnhancedPlayTime.admin is a special permission node that allows access to ALL EnhancedPlayTime's sub-commands. Grant this to users/groups with caution ;-)

/playtime [<pageno>]

(executable by: console/player)
(perm. node. required: EnhancedPlayTime.playtime)
Displays text based PlayTime board, one page at a time. You can list which page number with the optional <pageno> parameter.


/playtime topn <number_of_players>

(executable by: console/player)
(perm. node. required: EnhancedPlayTime.topn)

Sets the text based PlayTime board to display Top < number_of_players > Play/AFK Times, one page at a time.

Updates config.yml and default is Top 10 players.


/playtime holotopn <number_of_players>
(executable by: console/player)
(perm. node. required: EnhancedPlayTime.holotopn)

Sets the default number of players (Top N players) used for creating hologram boards.

Updates config.yml and default is Top 10 players.

/playtime pagesize <number_of_players>
(executable by: console/player)
(perm. node. required: EnhancedPlayTime.pagesize)
Sets the text based PlayTime board to display < number_of_players > per page i.e. number of players displayed formatted as per PlayTime->detail section of config.yml.

Updates config.yml and default is 10 players/detail sections per page.


/playtime reload
(executable by: console/player)
(perm. node. required: EnhancedPlayTime.reload)

Reloads plugin and re-loads database (play/afk times, player exclusion list, hologram info), reloads all offline players excluding players by all 3 exclusion methods ( see Description ). Re-hooks to external plugins, re-creates any hologram boards.

/playtime help [sub-command]
(executable by: console/player)
Lists specific help on [sub-command] or all playtime sub-commands with description, usage and help info.
(perm. node. required: EnhancedPlayTime.help)


/playtime about

(executable by: console/player)
(perm. node. required: EnhancedPlayTime.about)

Displays plugin name, version and author info.


/playtime exclude sub-commands:
All exclude sub commands require perm. node: EnhancedPlayTime.exclude and all (except list) require an additional relevant perm. node (see below).

If you wish to grant access to all exclude sub-commands then grant EnhancedPlayTime.exclude.* to relevant group or user.


/playtime exclude list [page_no]

(executable by: console/player)
(perm. node. required: )
Lists all players on the excluded player list page at a time (which are stored/updated permanently in the SQLite database ( playTimes.db ).
If [page_no] not specified defaults to page 1.

ExcludePageSize: key in config.yml sets number of players listed per page.

This list is formatted as per the Exclude->Header: Exclude->Detail, Exclude->Footer sections in config.yml.


/playtime exclude add <player_name|player_uuid>
(executable by: console/player)
(perm. node. required: EnhancedPlayTime.exclude.add)

Adds player specfied either by name (case-insensitive) or by UUID to exclusion list and updates SQLLite database exclusion table.

/playtime exclude remove <player_name|player_uuid>

(executable by: console/player)
(perm. node. required: EnhancedPlayTime.exclude.remove)
Removes player specfied either by name (case-insensitive) or by UUID from exclusion list and updates SQLLite database exclusion table.

/playtime hologram sub-commands:
All exclude sub commands require perm. node :
EnhancedPlayTime.hologram and all sub-commands except list require an additional relevant perm. node (see below).

If you wish to grant access to all exclude sub-commands then grant EnhancedPlayTime.hologram.* to relevant group or user.


/playtime hologram list [page_no]
(executable by: console/player)
(additional perm. node. required: )
Lists all EnhancedPlayTime holograms page at a time (details stored/updated permanently in the SQLite database ( playTimes.db ).
If [page_no] not specified defaults to page 1.


HoloPageSize: key in config.yml sets number of hologams listed per page.

This list is formatted as per the HologramList->Header: HologramList ->Detail, HologramList ->Footer sections in config.yml.

/playtime hologram add <hologram_name> [update_interval] [hologram_board_file]
(executable by: player)
( additional perm. node. required: EnhancedPlayTime.hologram.add)

Creates Hologram board named <hologram_name> at players location (offset by HoloOffset: key value in config.yml ).

The hologram is formatted to user-defined format defined by Hologram->Header: Hologram->Detail: & Hologram->Footer: sections in config.yml .

Hologram lists play/afk time players page at a time. Default Page Size/No. Players info defined by HoloPageSize: key value in config.yml. This can be updated via /playtime hologram pagesize.

Each page is displayed for time period (ticks) defined by HoloPageInterval: key value in config.yml

You can specify how often it updates via [update_interval] parameter or it will update via HoloUpdateInterval key value (defined in config.yml )

Finally you can specify which hologram board template file your hologram will use via the [hologram_board_file] optional parameter.


/playtime hologram remove <hologram_name>
(executable by: console/player)
( additional perm. node. required: EnhancedPlayTime.hologram.remove)


Removes Hologram board <hologram_name> permanently from world and SQLite database.

/playtime hologram movehere <hologram_name>
(executable by: player)
( additional perm. node. required: EnhancedPlayTime.hologram.movehere


Moves hologram board <hologram_name> to player's current location (offset by HoloOffset: key value in config.yml ).

/playtime hologram tp <hologram_name>
(executable by: player)
( additional perm. node. required: EnhancedPlayTime.hologram.tp)


Teleports/moves player to Hologram <hologram_name> 's location.


/playtime hologram pagesize <hologram_name> [no_of_players]
(executable by: console/player)
( additional perm. node. required: EnhancedPlayTime.hologram.pagesize)


Updates/sets hologram <hologram_name> 's page size to either default size specified by HoloPageSize : key value in config.yml or by [no_of_players] optional parameter. Hologram <hologram_name>' s current page is reset to page 1

/playtime hologram topn <hologram_name> [no_of_players]
(executable by: console/player)

( additional perm. node. required: EnhancedPlayTime.hologram.topn)

Updates/sets hologram <hologram_name> 's TopN to either default specified by HoloTopNPlayers : key value in config.yml or by [no_of_players] optional parameter. Hologram <hologram_name>' s current page is reset to page 1

/playtime hologram boardfile <hologram_name> [hologram_board_file]
(executable by: console/player)

( additional perm. node. required: EnhancedPlayTime.hologram.boardfile)
Update an existing hologram board to use [ hologram_board_file] hologram board template file. If you omit this parameter it will default to default.yml hologram board file.

EnhancedPlayTime-Dependancies.png
EnhancedPlayTime doesn't have any mandatory plugin's, these are all optional to enable extra features when it finds and hooks into them upon server startup or plugin reload.

Vault (For Offline Player permissions for ExcludePermNode: permission node in config.yml)
http://dev.bukkit.org/bukkit-plugins/vault/

EssentialsX (When AFKMethod: Essentials set in config.yml)
https://www.spigotmc.org/resources/essentialsx.9089/

Holographic Displays ( for holograms/hologaphic playtime boards )
http://dev.bukkit.org/bukkit-plugins/holographic-displays/

Clip's PlaceholderAPI ( for external plugin placeholder variables )
https://www.spigotmc.org/resources/placeholderapi.6245/

EnhancedPlayTime-config.png
Code (Text):
Enable: true
CheckUpdates: true
Aliases:
- 'ept'
- 'pt'
DefTopNPlayers: 10
ExcludePermNode: EnhancedPlayTime.excludeplayer
ExcludeDays: 30
DateFormat: dd-MM-yyyy HH:mm
PlayTimeFormat: "&a{day} &6day(s), &a{hour} &6hr(s), &a{min} &6min(s), &a{sec} &6sec(s)"
AFKTimeFormat: "&a{day} &6day(s), &a{hour} &6hr(s), &a{min} &6min(s), &a{sec} &6sec(s)"
AFKMethod: Essentials
AFKTime: 30
UpdateDBInterval: 60
SaveToDBOnQuit: true
PlaceHolderEmpty: ''
#
# PLAYTIME CMD CONFIG
#
PlayTimePageSize: 10
PlayTime:
  Header:
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '&6Server: &f{servername}  &6Date: &f{date}'
  - '&6Online Players: &f{totalonlineplayers}  &6Excluded List Players: &f{totalexcludeplayers}'
  - '&e***** &6TOP &f{topnplayers} &6PLAY TIMES Of &f{totalofflineplayers} &6PLAYERS &e*****'
  - '&e***** &6LAST PLAYED UNDER &f{excludedays}&6 Days &e*****'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  Detail:
  - '&f&l{lineno}&e.              Name: &f&l{player}'
  - '                &eUUID: &a{playeruuid}'
  - '&eTotal Playing Time: &a{playtime_fmt} '
  - '    &eTotal AFK Time: &a{afktime_fmt} '
  - '&e****************************************************************'
  Footer:
  - '&6---- Page &a{pageno} &6Of &a{totalpages} &6----'
#
ExcludePageSize: 10
Exclude:
  Header:
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '&6Server: &f{servername}  &6Date: &f{date}'
  - '&6Total Excluded List Players: &f{totalexcludeplayers}'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  Detail:
  - '&f&l{lineno}&e.         Name: &f&l{excludedplayer}'
  - '           &eUUID: &a{excludedplayeruuid}'
  - '     &eDate Added: &a{updatedbydate}'
  - '&e****************************************************************'
  Footer:
  - '&6---- Page &a{pageno} &6Of &a{totalpages} &6----'
#
# HOLOGRAM CONFIG
#
HoloListPageSize: 10
HologramList:
  Header:
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '&6Server: &f{servername}  &6Date: &f{date}'
  - '&6Total Holograms: &f{totalholograms}'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  Detail:
  - '&f&l{lineno}&e.           Name: &f&l{holoname}'
  - '         &eLocation: &a{hololocation}'
  - '&eUpdate Interval: &a{holoupdintsecs} &6sec(s)'
  - '     &eCreated By: &a{updatedbyplayer}&6 On &a{updatedbydate}'
  - '&e****************************************************************'
  Footer:
  - '&6---- Page &a{pageno} &6Of &a{totalpages} &6----'
#
#
HoloTopNPlayers: 10
HoloPageInterval: 80
HoloUpdateInterval: 10
HoloPageSize: 10
HoloOffset: 0.0,4.0,0.0
Hologram:
  Header:
  - '{icon:DIAMOND}'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '&eServer: {servername}  &eDate: &f{date}'
  - '&eExcluded List Players: &f{totalexcludeplayers}'
  - '&e***** &6TOP &f{topnplayers} &6PLAY TIMES Of &f{totalofflineplayers} &6PLAYERS &e*****'
  - '&e***** &6LAST PLAYED UNDER &f{excludedays}&6 Days &e*****'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  Detail:
  - '&6{lineno}: &f&l{player}&6, Playing Time= &f{pt_dd}&6d:&f{pt_hh_fmt}&6h:&f{pt_mm_fmt}&6m:&f{pt_ss_fmt}&6s'
  - '&6{lineno}: &f&l{player}&6, AFK Time= &f{afk_dd}&6d:&f{afk_hh_fmt}&6h:&f{afk_mm_fmt}&6m:&f{afk_ss_fmt}&6s'
  Footer:
  - '&e---- Page &6{pageno} &eOf &6{totalpages} &e----'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '&6Enhanced&ePlayTime &f(C) 2017 &1&lL&2&lO&3&l&lZ&4&lZ&c&lSoft'
  - '&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e=&6-&e='
  - '{icon:DIAMOND}'

Explanation:-

Whilst some options are self-explanatory, info for the less obvious options below!:-

CheckUpdates: Defaults to true/yes. Display update URL upon server startup/plugin enabled if update is available from SpigotMC.org!

Aliases: Add multiple command override aliases (these should override any existing commands should you pick a command alias that already exists).

DefTopNPlayers : Sets the total number of player balances displayed for text based /baltop balance boards.

ExcludePermNode : Custom permission node also used for excluding players in addition to other exclusion methods (see Description). This works with most permission plug-ins ( PEX , bPermissions , GroupManager etc) as supported by Vault permissions.

ExcludeDays: Set number of days to exclude player play/afk times via their last played date/time. This defaults to 30 meaning any players played/logged in for over 30 days will be excluded.Set this to 0 to disable this feature.

DateFormat : Standard Java date format for header/footer/detail config lines containing {date} variable in config file.

PlayTimeFormat : Format used by {playtime_fmt} variable used in text/hologram playtime detail lines.

AFKTimeFormat : Format used by {afktime_fmt} variable used in text/hologram playtime detail lines.

AFKMethod: Set to Essentials (default) to hook into EssentialsX plugin (if loaded) and use its API's AFK methods. Any other value sets EnhancedPlayTime 's internal AFK detection algorithm method via tracking player text/interact/move events.

AFKMethod: Defaults to 30 seconds. If AFKMethod is NOT Essentials i.e. internal AFK detection method, this is the Inactivity period it uses before flagging a player is AFK if not tracked player event occurred.

UpdateDBInterval : Defaults to 60 seconds. Interval for online player play/afk times are updated in the SQLite database ( playTimes.db )

SaveToDBOnQuit: Defaults to true/yes. Specifies whether online player play/afk time data updated in SQLite database on quit.

PlaceholderEmpty: String to display if PlaceHolderAPI variable string wrapped with % (e.g. %statistic_player_kills%) returns empty string or unresolved. Defaults to '' (Empty).

Edit the relevant Header, Detail and Footer keys to customise your Text based /playtime and hologram board format....

Header & Footer (PlayTime/Exclude/HologramList/Hologram keys )
The headers and footer config lines for text based
& holographic balance boards can have multiple lines as can be seen by the config,

They also support single line holographic icons/itemlines (as per holographic displays spec) using the {icon:xx} variable

Detail ( Header & Footer (PlayTime/Exclude/HologramList/Hologram keys )
Multiple details line which are normally used to display the player name and their associated balance.


All color coding and formatting codes support using & prefix.

EnhancedPlayTime-Variables.png
Hologram/Text Boards

{ player } - Player's full Minecraft User Name
{ playeruuid } - Player's Minecraft UUID
{ playtime } - Player's total playing time formatted as
days:hours:minutes:seconds (leading 0 on all
except days)
{ playtime_fmt} - Player's total playing time formatted to
PlayTimeFormat: key format in config.yml.
{ afktime } - Player's total afk time formatted as
days:hours:minutes:seconds (leading 0 on all
except days)
{ afktime_fmt } - Player's total afk time formatted to
AfKTimeFormat: key format in config.yml.
{playtimeafk}
- Player's total playing time minus player's total afk
time. Formatted as days:hours:minutes:seconds
(leading 0 on all except days)
{playtimeafk_fmt} - Player's total playing time minus player's total afk
time formatted to

PlayTimeFormat: key format in config.yml.

{ t opnplayers } - Current board's TopNPlayer value.
{ excludedays } - ExcludeDays: key value in config.yml

{ servername } - Current server name.
{ lineno } - Header/Footer actual line number or for detail
sections, player item number in Board's List
{ pageno } - Current board page number.
{ totalpages } - Total number of pages used for current board.
{ player } - Player's (Minecraft) full user name.
{ date } - Current Date/Time formatted as per DateFormat in
config.yml.
{ totalonlineplayers } - Total number of currently online players.
{ totalofflineplayers } - Total number of offline players that have logged
onto the server (this include online players count)

Hologram Board Variables

{ holoname } - Hologram Name.
{holoboardname} - Hologram Board Template File Name
{ holoworld } - Hologram Location, World Name.
{ hololocx } - Hologram Location, X Coord. to 2 decimal places.
{ hololocy } - Hologram Location, Y Coord. to 2 decimal places.
{ hololocz } - Hologram Location, Z Coord. to 2 decimal places.
{ hololocation } - Hologram Location. Displays world, x, y, z coords.
to 2 decimal places.
{ holoupdintsecs } - Hologram update interval in Seconds.
{ holoupdint } - Hologram update interval in Ticks (norm. 1/20 sec).
{ totalholograms } - Total Number of defined/created hologram boards.


{ icon: <materialname> } - Where the <materialname> is the standard CraftBukkit material name.
or
{ icon: <materialname> : <datavalue> }
- Where the <materialname> is the standard CraftBukkit material name, followed by
<datavalue> required for certain items.
{icon: playerhead}
or

{icon :p layerskull} - Get itemstack for current player's head which
will appear as a holographic floating and rotating
head/skull.

{icon: playerhead:<playername>}
or
{icon :p layerskull:<playername>}
-
Get itemstack for <playername> 's head/skull
which will appear as a holographic floating and
rotating head/skull.



For more info refer to https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html


Future Ideas/Additions:-


I have some new ideas in mind, which I may add to a premium version of this plugin, depending on feedback :)

These are:-

Let me know if you have any sensible and great ideas with regards to what you'd like to see added to this plugin o_O

If you like my work please consider donating to me, by clicking donate below.

MANY THANKS :p
-Lozz

[​IMG] btn_donate_LG.gif

Commands

Plugin details

Read from the plugin's own plugin.yml.

Quick facts

Install steps are the general flow for this file type — How to install Minecraft Java mods & modpacks walks through it step by step.

Enhanced PlayTime is a free Minecraft Java mod. Compatible with Minecraft 1.8, 1.9, 1.10, 1.11 and newer. Downloaded 7,702 times (via Spigot). Download it and open it directly in the game.

Explore more