Mineuniverse
Log in Register
Plugins

WorldTimeTracker

Track Players time in each world
by RayHerring
Download Claim this project
989 downloads
0 likes
Updated Jun 30, 2026
0 hypes
Admin Tools Informational

Description

Tracks the time a player spends in each world into an SQL database, useful for giving people different rewards or ranking them up, etc...

WorldTimeTracker is designed to be extremely simple, it stores only what it needs to store, items stored are:

  • Player Name
  • World Name
  • Total Time spent in world

The plugin tracks the total time spent based on a variety of factors, when the player logs onto the server, an in-memory object is set up that matches the table structure, except instead of total time, it merely tracks when they logged on in that particular world.

When the player disconnects, it takes the difference between their connection in that world and their disconnection from that world and adds that to their record in the SQL database.

When the player changes to another world, it goes through the same motions as a disconnection, and then the same motions as a connection but using the new world information.

There should be extremely minimal impact from this plugin, since it only ever updates the SQL database when the player changes worlds or disconnects.

Configuration

config.yml

  • MySQLServer: localhost
  • MySQLPort: '3306'
  • MySQLUsername: <username for db>
  • MySQLPassword: <password for db>
  • MySQLDatabase: <database to use>
  • MySQLTable: <table to use>
  • showDebug: true|false

As per my other plugins that utilise SQL, this plugin will automatically create the table if it doesn't exist, and any table changes that occur in future releases will auto-update the existing table.

Example Usage

Depending on what you want to do, because of how the information is stored, retrieving specific information is very easy, and retrieving total information for a player is also very easy.

One Player - One World

SELECT * FROM WorldTimeTracker WHERE player_name="fred" AND world_name="world"

One Player - All Worlds

SELECT SUM(total_time) FROM WorldTimeTracker WHERE player_name="fred"

Times are all stored as integers, standard PHP date and time functions should be able to turn the integers into meaningful information.

WorldTimeTracker v0.1
MC CB 1.4.5-R0.2
Release 2013-04-20 Get

More from RayHerring

SlimeChunkDisabler
6,412
OnlinePlayersSQL
16,202
Slime Chunk Detector
11,021
ChatKKiller
1,082

You Might Also Like

AdBolt Advertising Network
Make money from your Minecraft server by running ads!
9,992
Mineload
Mineload
9,978
BeastTP
BeastTP v1.0 - Teleportation Made Easy! -[Permissions][1317]
9,966
RegionManager
generate regions with just one command!
9,950
TimeKeeper
Keep the Server-Playtime per Day
9,948
SimpleAdmin
simple way to ban/kick unwanted players from your server
9,945