Mineuniverse
Plugins

WorldTimeTracker

PLUGIN
Track Players time in each world
by RayHerring
Download Claim this project
Add a badge to your pageLink to WorldTimeTracker from a README, website or forum post.
Preview: Badge

Badges update automatically and link to the plugin page on MineUniverse.

1,039 downloads
0 likes
0 followers
Updated Oct 14, 2026
0 hypes
Follow0
Admin Tools Informational
Advertisement Remove ads with Premium →

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

Advertisement Remove ads with Premium →

You Might Also Like