OnlineTime icon

OnlineTime -----

Capture time that players have accumulated on your server or network.



This plugin measures the total time players are connected to your server or network.

This plugin is based on Mr_Minecraft15's plugin OnlineTime, but I've more or less completely rewritten everything up to the point where it is barely noticeable.

This plugin requires Spigot or Paper, it won't work with CraftBukkit! (But does run with both Bungee and Waterfall.)

Please be aware that by default there is no communication between Bungee and Spigot.
But to use all features of a Bungeecord setup, the plugin must be installed on both Bungee and Spigot and the config adjusted by setting mode of all Spigot instances to slave and mode of the Bungee instance to master.

If you update from 1.1.2 or below, you need to readjust the recreated config to your previous state! Backups will be created.

Features:
  • Every message (including prefix) is customizable!
  • Store data in YAML or MySQL
  • extreme multiprogramming, zero blocking operations on I/O-threads cause zero lag
  • PlaceholderAPI support
Commands:
Code (Text):
/onlinetime [playername or uuid] - show online time of player
/ot [playername or uuid] - alias for /onlinetime
/onlinetimeadmin set [playername or uuid] [time] - set a players online time to the given amount
/onlinetimeadmin mod [playername or uuid] [time] - modify a players online time by the given amount
/onlinetimeadmin reset [playername or uuid] - reset a players online time to zero
/ota (set|mod|reset) … - alias for /onlinetimeadmin
The time argument accepts values as follows:
  • just any whole number: interpreted as seconds
  • multiple combination of amount with unit: the sum of given amount
    Examples:
    • 4h 3min - 4 hours and 3 minutes
    • 28 d 3 h - 28 days and 3 hours
    • 2w1d - 2 weeks and one day
    • 1h -5min - 1 hour minus 5 minutes or 55 minutes
    • -6 d - subtract 6 days (only using modify)

Permissions:
Code (Text):
onlinetime.see - see your recorded online time
onlinetime.see.other - see other players recorded online time
onlinetime.admin - modify all entries
PlaceholderAPI:
Code (Text):
%onlinetime_string% - formatted string (same as when using /onlinetime)
%onlinetime_only_seconds% - seconds, as in formatted string (without unit)
%onlinetime_only_minutes% - minutes, as in formatted string (without unit)
%onlinetime_only_hours% - hours, as in formatted string (without unit)
%onlinetime_only_days% - days, as in formatted string (without unit)
%onlinetime_only_weeks% - weeks, as in formatted string (without unit)
%onlinetime_only_months% - months, as in formatted string (without unit)
%onlinetime_only_years% - years, as in formatted string (without unit)
%onlinetime_all_seconds% - whole time in seconds
%onlinetime_all_minutes% - whole time in minutes
%onlinetime_all_hours% - whole time in hours
%onlinetime_all_days% - whole time in days
%onlinetime_all_weeks% - whole time in weeks
%onlinetime_all_months% - whole time in months
%onlinetime_all_years% - whole time in years
Configuration:
To use this plugin as standalone:
Code (YAML):
language : 'en' # for available languages see / edit messages.yml
servername
: 'this server'
messageformat
: '&gray&\ [ [OnlineTime ] (dark_aqua )\ ] %message%' # See https://github.com/Phoenix616/MineDown#syntax
saveinterval
: 30 # seconds
storage
: 'yaml' # to use e.g. mysql set to 'database' and configure database.properties
mode
: 'standalone' # use 'master' on Bungee and 'slave' on Spigot for to enable communication between server and proxy
configversion
: 2 # Never manually edit this value! It is used to migrate older configurations to the current version.

To use this plugin on both Bungee and Spigot:

Plugin config of Bungee instance:
Code (YAML):
language : 'en' # for available languages see / edit messages.yml
servername
: 'this server'
messageformat
: '&gray&\ [ [OnlineTime ] (dark_aqua )\ ] %message%' # See https://github.com/Phoenix616/MineDown#syntax
saveinterval
: 30 # seconds
storage
: 'yaml' # to use e.g. mysql set to 'database' and configure database.properties
mode
: 'master' # use 'master' on Bungee and 'slave' on Spigot for to enable communication between server and proxy
configversion
: 2 # Never manually edit this value! It is used to migrate older configurations to the current version.
Plugin config on Spigot instance:
Code (YAML):
language : 'en' # used for PlaceholderAPI %onlinetime_string%
servername
: 'this server' # unused
messageformat
: '&gray&\ [ [OnlineTime ] (dark_aqua )\ ] %message%' # unused
saveinterval
: 30 # seconds - intervall to update time from bungee
storage
: 'yaml' # unused
mode
: 'slave' # use 'master' on Bungee and 'slave' on Spigot for to enable communication between server and proxy
configversion
: 2 # Never manually edit this value! It is used to migrate older configurations to the current version.
Database configuration:
After setting storage option to database and restarting the server a database.properties file should be created:
Code (Text):
# See https://github.com/brettwooldridge/HikariCP#configuration-knobs-baby
dataSourceClassName=mr.minecraft15.onlinetime.libraries.mariadb.jdbc.MariaDbDataSource
dataSource.user=minecraft_user
dataSource.password=password
dataSource.databaseName=minecraft_database
dataSource.portNumber=3306
dataSource.serverName=127.0.0.1
You may use another database if you provide the matching data source class, but be aware, that there is no guaranteed support.

Planned / Ideas:
See enhancement labeled issues.

Special thanks to:
yudete for adding Japanese translation
hammad_alhassan for donating

License:
This plugin is licensed under the MIT license:
Resource Information
Author:
----------
Total Downloads: 4,204
First Release: Apr 8, 2019
Last Update: Sep 30, 2023
Category: ---------------
All-Time Rating:
9 ratings
Version -----
Released: --------------------
Downloads: ------
Version Rating:
----------------------
-- ratings