A Minecraft Plugin designed to track Each Player's Playtime. AFK Detection, Playtime Tournaments, Prefixes and more!
⌛PlaytimeUtils⌛
Is a powerful, lightweight playtime tracking plugin for Minecraft Servers, designed to effortlessly monitor player activity. Gather engagement by organizing Custom Playtime Tournaments, apply Custom Prefixes, manage active players with ease and much more today!
Main Features
- Optimized AFK Detection: Super-lightweight movement tracking to keep server performance clean.
- Dual Database Support: Works seamlessly with local SQLite (.db file) or remote MySQL networks.
- Playtime Tournaments: With simple configuration via commands/Interactive GUIs.
- Dynamic AFK Prefix: Automatically assign custom prefixes to inactive players.
- First-Join Celebrations: Fully configurable titles, subtitles, and sounds for new players.
Dependencies
1.) Placeholder API (PAPI)
- Allows the use of placeholders in every message of the plugin.
- Gives access to the custom playtime placeholders, which allows you to display the playtime in scoreboards, tab lists, etc.
2.) LuckPerms
- Needed for the custom AFK prefix.
These are all SOFT-DEPENDENCIES, meaning you don't need these plugins installed on your server, but it may improve the functionality of PlaytimeUtils.
Configuration File
Click to View
#Developed by _ItsAndrew_
#Main configuration file for PlaytimeUtils.
#Configure the database manager
database:
type: sqlite #This is the type of the database. If you run a network with multiple servers, use 'mysql'! If you run only 1 server, use 'sqlite'!
file-name: "database.db" #This is ONLY for SQLite, and it is ONLY the name for the file.
#These are the settings for the MySQL database. If you don't use MySQL, you can ignore this.
host: ""
port: ""
database: ""
username: ""
password: ""
#Configure general messages. Use '&' for colors/styles. You can also use PAPI placeholders!
messages:
no-permission: "&cYou don't have permission to do that!"
my-playtime:
main: "&aYour playtime is &e&l%playtime_mainValue%&a!" #Use %playtime_mainValue% to display the main playtime
tournament: "&aYour current playtime in the tournament is &e&l%playtime_tournamentValue%&a!" #Use %playtime_tournamentValue% to display the tournament playtime
player-playtime:
main: "&a%player%'s playtime is &e&l%playtime_mainValue%&a!" #Use %player% to display the player's name and %playtime_mainValue% to display their main playtime'
tournament: "&a%player%'s playtime is &e&l%playtime_tournamentValue%&a!" #Use %player% to display the player's name and %playtime_tournamentValue% to display their tournament playtime'
player-afk: "&7You are now AFK!"
player-no-more-afk: "&7You are not AFK anymore."
#Configure the top 3 MAIN PLAYTIME Message that can be sent when a player runs /topplaytime main
#Available Placeholders: '%playtime_top1ign%'/'%playtime_top1%' -> Top 1 player's IGN/Playtime
# '%playtime_top2ign%'/'%playtime_top2%' -> Top 2 player's IGN/Playtime
# '%playtime_top3ign%'/'%playtime_top3%' -> Top 3 player's IGN/Playtime
top-3-main-players:
- "&c&l---------------------------------"
- " "
- " &d&lTOP MAIN PLAYTIME"
- " "
- " &e&l1. &e%playtime_top1ign% &f%playtime_top1%"
- " &7&l2. &7%playtime_top2ign% &f%playtime_top2%"
- " &6&l3. &6%playtime_top3ign% &f%playtime_top3%"
- " "
- "&c&l---------------------------------"
#Configure the Top 3 TOURNAMENT PLAYTIME Message that will be sent when a player runs /topplaytime tournament
#Placeholders: '%playtime_top1tournamentign%'/'%playtime_top1tournament%' -> Top 1 player IGN/Playtime
# '%playtime_top2tournamentign%'/'%playtime_top2tournament%' -> Top 2 player IGN/Playtime
# '%playtime_top3tournamentign%'/'%playtime_top3tournament%' -> Top 3 player IGN/Playtime
top-3-tournament-players:
- "&c&l---------------------------------"
- " "
- " &d&lTOP TOURNAMENT PLAYTIME"
- " "
- " &e&l1. &e%playtime_top1tournamentign% &f%playtime_top1tournament%"
- " &7&l2. &7%playtime_top2tournamentign% &f%playtime_top2tournament%"
- " &6&l3. &6%playtime_top3tournamentign% &f%playtime_top3tournament%"
- " "
- "&c&l---------------------------------"
#Set the seconds for when a player should be set on AFK
afk-seconds: 4 #In seconds!
lp-afk-prefix: "&7&l[AFK] &7" #Set the prefix for an AFK player. Note that this only works if you have LuckPerms enabled on your server.
#Configure the sound / titles when a player joins for the first time. Use '&' for styles/colors.
#First join means if the player is not registered in the database.
#You can also use PAPI placeholders!
first-join:
toggle: true #If you want this feature or not
title: "&d&lWELCOME!"
subtitle: ""
sound: entity.player.levelup
sound-volume: 1.0
sound-pitch: 1.0
#Configure the Reward System. This will be like a mini-tournament system.
reward-system:
toggle: false #If you want to use Rewards or not.
#Set the timer for the tournament. (In DAYS)
tournament-timer: 7 #As you can see, by default it is set to 7 days/1 week.
#Configure the sounds for the tournament.
tournament-sounds:
start:
name: block.note_block.pling
pitch: 1.0
volume: 1.0
disabled:
name: block.note_block.pling
volume: 1.0
pitch: 1.0
end:
name: entity.player.levelup
volume: 1.0
pitch: 1.0
1/3-of-duration:
name: block.note_block.pling
volume: 1.0
pitch: 1.0
half-of-duration:
name: block.note_block.pling
volume: 1.0
pitch: 1.0
5/6-of-duration:
name: block.note_block.pling
volume: 1.0
pitch: 1.0
#Configure the tournament chat message at these timestamps. You may use PAPI placeholders and '&' for colors!
tournament-messages:
#You may even use the word 'Discord' in any of the messages below, then put your discord server link here to have a clickable word which
#will redirect the player to your Discord Server Invite.
discord-link: ""
discord-hover-text: "Click here to join our Discord Server!"
#Placeholders: '%tournament_enddate%' -> The date (e.g.: 24 Mar 2026) when the tournament ends.
# '%tournament_duration%' -> The duration of the tournament (e.g.: 5d 12h 30m 45s)
start:
- "&c&l======[&f&lPLAYTIME TOURNAMENT STARTS &e&lNOW&c&l]======"
- " "
- "&7Until &e%tournament_enddate%&7, you have the chance to win &e&limpressive rewards&7!"
- "&7Play as much as you can, &eclimb the leaderboard&7 and &eget the best rewards&7."
- " "
- "&b&lHow Can I See My Playtime?"
- " &7To see your playtime, use the &e/myplaytime&7 command!"
- "&7You may also use &e/topplaytime&7 to see the top 3 players!"
- " "
- " &7We wish you all &6&lGood Luck &7and &e&lHappy Playing&7!"
- " &7&oFor more information, join our &9Discord Server&7!"
- " "
- "&c&l======[&f&lPLAYTIME TOURNAMENT ENDS IN &4&l%tournament_duration%&c&l]======"
disabled:
- "&c&l===============[&f&lPLAYTIME TOURNAMENT DISABLED&c&l]==============="
- " "
- " &7The tournament &ehas been disabled &7by the server owner!"
- "&7If you would like to know more, see more information on &9our Discord Server."
- " "
- "&c&l===================================================================="
#Placeholders: '%tournament_topNtournament%' -> The top N player's playtime.
# '%tournament_topNtournamentign%' -> The top N player's IGN.
end:
- "&c&l======[&f&lPLAYTIME TOURNAMENT &e&lENDS NOW&c&l]======"
- " "
- " &7After all this time, the tournament has come to an end."
- " &7We hope you had fun and enjoyed this event! "
- " "
- " &a&lFINAL STANDINGS"
- " &e&l1. &e%playtime_top1tournamentign% &f%playtime_top1tournament%"
- " &7&l2. &7%playtime_top2tournamentign% &f%playtime_top2tournament%"
- " &6&l3. &6%playtime_top3tournamentign% &f%playtime_top3tournament%"
- " "
- " &f&oIf you haven't received your reward, join our &9Discord Server &f&oand &e&osubmit a ticket&f&o!"
- " "
- "&c&l======================================================="
#Placeholders: '%tournament_enddate%' -> The date (e.g.: 24 Mar 2026) when the tournament ends.
# '%tournament_duration%' -> The duration of the tournament (e.g.: 5d 12h 30m)
# '%tournament_topNtournament%' -> The top N player's playtime.
# '%tournament_topNtournamentign%' -> The top N player's IGN.
1/3-of-duration:
- "&c&l======[&f&lPLAYTIME TOURNAMENT ANNOUNCEMENT&c&l]======"
- " "
- "&7Want to win &eexpensive items &7easily? Then this event is for you!"
- "&7Play as much as you can, &eclimb the leaderboard&7 and &eget the best rewards&7!"
- " "
- "&b&lHow Can I See My Playtime?"
- " &7To see your playtime, use the &e/myplaytime&7 command!"
- "&7You may also use &e/topplaytime&7 to see the top 3 players!"
- " "
- " &a&lCURRENT LEADERBOARD"
- " &e&l1. &e%playtime_top1tournamentign% &f%playtime_top1tournament%"
- " &7&l2. &7%playtime_top2tournamentign% &f%playtime_top2tournament%"
- " &6&l3. &6%playtime_top3tournamentign% &f%playtime_top3tournament%"
- " "
- " "
- " &7Have a question? Join our &9Discord Server&7!"
- "&c&l======[&f&lPLAYTIME TOURNAMENT ENDS IN &4&l%tournament_duration%&c&l]======"
#Placeholders: '%tournament_enddate%' -> The date (e.g.: 24 Mar 2026) when the tournament ends.
# '%tournament_duration%' -> The duration of the tournament (e.g.: 5d 12h 30m)
# '%tournament_topNtournament%' -> The top N player's playtime.
# '%tournament_topNtournamentign%' -> The top N player's IGN.
half-of-duration:
- "&c&l======[&f&lPLAYTIME TOURNAMENT ANNOUNCEMENT&c&l]======"
- " "
- "&7Want to win &eexpensive items &7easily? Then this event is for you!"
- "&7Play as much as you can, &eclimb the leaderboard&7 and &eget the best rewards&7!"
- " "
- "&b&lHow Can I See My Playtime?"
- " &7To see your playtime, use the &e/myplaytime&7 command!"
- "&7You may also use &e/topplaytime&7 to see the top 3 players!"
- " "
- " &a&lCURRENT LEADERBOARD"
- " &e&l1. &e%playtime_top1tournamentign% &f%playtime_top1tournament%"
- " &7&l2. &7%playtime_top2tournamentign% &f%playtime_top2tournament%"
- " &6&l3. &6%playtime_top3tournamentign% &f%playtime_top3tournament%"
- " "
- " &7Have a question? Join our &9Discord Server&7!"
- "&c&l======[&f&lPLAYTIME TOURNAMENT ENDS IN &4&l%tournament_duration%&c&l]======"
#Placeholders: '%tournament_enddate%' -> The date (e.g.: 24 Mar 2026) when the tournament ends.
# '%tournament_duration%' -> The duration of the tournament (e.g.: 5d 12h 30m)
# '%tournament_topNtournament%' -> The top N player's playtime.
# '%tournament_topNtournamentign%' -> The top N player's IGN.
5/6-of-duration:
- "&c&l======[&f&lPLAYTIME TOURNAMENT ANNOUNCEMENT&c&l]======"
- " "
- "&7Want to win &eexpensive items &7easily? Then this event is for you!"
- "&7Play as much as you can, &eclimb the leaderboard&7 and &eget the best rewards&7!"
- " "
- "&b&lHow Can I See My Playtime?"
- " &7To see your playtime, use the &e/myplaytime&7 command!"
- "&7You may also use &e/topplaytime&7 to see the top 3 players!"
- " "
- " &a&lCURRENT LEADERBOARD"
- " &e&l1. &e%playtime_top1tournamentign% &f%playtime_top1tournament%"
- " &7&l2. &7%playtime_top2tournamentign% &f%playtime_top2tournament%"
- " &6&l3. &6%playtime_top3tournamentign% &f%playtime_top3tournament%"
- " "
- " &7Have a question? Join our &9Discord Server&7!"
- "&c&l======[&f&lPLAYTIME TOURNAMENT ENDS IN &4&l%tournament_duration%&c&l]======"
#Configure the item which the winners will get to claim their rewards.
rewards-item:
material: ENDER_CHEST
display-name: "&e&lPlaytime Tournament Reward"
lore:
- " "
- "&7Click or Right Click to open your reward!"
#Set the lore of the item in the Playtime Rewards Menu.
playtime-rewards-menu-lore:
- " "
- "&7Click to get this reward."
#Configure some message. You may use PAPI Placeholders.
no-inventory-space-message: "&cYou don't have enough inventory space to claim your reward!"
reward-item-received-message: "&aYou have received your reward! &lClick &aor &lRight Click &ait to open."
reward-claimed-message: "&aYou have successfully claimed your reward!"
#The book for the winner who joins the server and has a pending reward. Like a notification. You may use PAPI Placeholders.
#Configure this book using the in-game command '/ptutils rewards tournament setbook'.
pending-reward-book:
title: ""
author: ""
pages: ""
#Configure the notification a winner will get if they don't have enough inventory space to claim their reward.
pending-reward-notification:
sound:
name: block.note_block.pling
volume: 1.0
pitch: 1.0
#You may use the word 'here' in the message to redirect the winner to the Playtime Rewards.
chat-message:
- "&cYou have a &lpending reward&c! Click &e&lhere &cor run &l/myplaytime rewards &cto claim it!"
#Set the hover text when the winner hovers over the 'here' word.
hover-text: "Click to open the Rewards Menu."
#Configure the Playtime Rewards GUI. It is the menu which appears when the player runs '/myplaytime rewards'.
playtime-rewards-menu:
title: "Your Playtime Rewards"
size: 54 #The size MUST BE a MULTIPLE OF 9!
#Configure the decoration of the menu. Basically items on the first and last row of the inventory.
decoration:
toggle: true
material: BLACK_STAINED_GLASS_PANE
display-name: " "
lore:
- ""
#Configure the 'Return' Button.
return-button:
slot: 40
material: ARROW
display-name: "&e&lRETURN"
lore:
- ""
#Configure the 'No Pending Rewards' Item.
no-pending-rewards-item:
slot: 22
material: BARRIER
display-name: "&cYou don't have any pending rewards!"
lore:
- ""
#The items/exp levels that will be given to players who win the tournament. Configure this through the in-game command '/ptutils rewards add/remove'.
rewards:
first-place:
exp-levels:
items:
second-place:
exp-levels:
items:
third-place:
exp-levels:
items:
Commands
/myplaytime <main | tournament> -> Displays your main/tournament playtime in chat
/myplaytime rewards -> Opens up the Playtime Rewards Menu
/playtime <main | tournament> -> Displays a player's main/tournament playtime
/topplaytime <main | tournament> -> Displays the Top 3 Main/Tournament Playtime Leaderboard
/ptutils reload -> Reloads the config.yml file
/ptutils rewards ... -> Manages the Rewards System
Permissions
playtimeutils.myplaytime -> Gives access to /myplaytime command
playtimeutils.myplaytime.main/tournament -> Allows the player to see their own main/tournament playtime
playtimeutils.myplaytime.rewards -> Allows the player to access the Playtime Rewards Menu
playtimeutils.playtime -> Gives access to /playtime command
playtimeutils.playtime.main/tournament -> Lets the player see another players' main/tournament playtime
playtimeutils.topplaytime -> Gives access to /topplaytime command
playtimeutils.topplaytime.main/tournament -> Allows the player to see the Top 3 Main/Tournament Playtime
playtimeutils.ptutils -> Gives access to the main configuration command
playtimeutils.ptutils.reload -> Allows the player to reload the config.yml file
playtimeutils.ptutils.rewards... -> Allows the player to manage the Rewards System via the designated commands.
Found a bug?
- Open an issue here or
- Send me a DM on my discord: _itsandrew_
I will try to solve every bug ASAP! This will help both me as a developer and you as a consumer.
Credits
PlaytimeUtils was developed and tested by me (ItsAndrew).
Again, special thanks to everyone who gives feedback via reviews/issues/discord.