promotional bannermobile promotional banner
premium banner
# PlayTime — Playtime & Last Seen Plugin for Hytale

Description

PlayTime — Playtime & Last Seen Plugin for Hytale

Version Hytale License

Lightweight server plugin that tracks when players were last online and how long they have played. Uses simple JSON storage, ships with three languages, and exposes two intuitive commands.


Quick Links


Features

  • Last seen: /seen <username> shows online status or last disconnect timestamp.
  • Playtime: /playtime <username> [--start=DATE] [--end=DATE] sums total or ranged playtime.
  • Date parsing: accepts dd/MM/yyyy-HH:mm or dd/MM/yyyy.
  • Multi-language: en_us, en_fr, en_ru bundled.
  • Zero external deps: stores per-player JSON in plugins/seenPlugin/data/players/.

Commands

  • /seen <username> — online/offline + last seen time.
  • /playtime <username> — total playtime.
  • /playtime <username> --start=dd/MM/yyyy-HH:mm --end=dd/MM/yyyy-HH:mm
  • /playtime <username> --start=dd/MM/yyyy --end=dd/MM/yyyy
  • Errors you may see:
    • Invalid date range: start date must be before end date.
    • Invalid start/end date: use dd/MM/yyyy-HH:mm or dd/MM/yyyy.

Installation

  1. Download PlayTime.jar from releases (or build locally).
  2. Place PlayTime.jar into your Hytale server plugins directory.
  3. Restart the server.

Usage Examples

/seen Loocik
/playtime Loocik
/playtime Loocik --start=01/03/2026 --end=09/03/2026
/playtime Loocik --start=01/03/2026-00:00 --end=09/03/2026-23:59

Configuration

  • Default language is set in code: Lang.init("en_us") inside Seen.
  • To switch language: change the argument in Seen.setup() or add your own JSON under lang/<code>.json and point Lang.init("<code>") to it.
  • Date/time uses server timezone (ZoneId.systemDefault()).

Build from Source

Requires JDK with javac and jar plus HytaleServer.jar on the classpath.

cd C:\Users\Loocik\Desktop\PlayTime1
if (Test-Path out) { Remove-Item out -Recurse -Force }
mkdir out
javac --release 11 -encoding UTF-8 -cp ".;com\example\plugin\HytaleServer.jar" -d out com\example\plugin\*.java
java -m jdk.jartool --create --file PlayTime.jar --manifest META-INF\MANIFEST.MF -C out . -C . lang -C . manifest.json

Data Format

Player files live at plugins/seenPlugin/data/players/<username>.json:

{
  "eventList": [
    { "timestamp": 1700000000, "connect": true },
    { "timestamp": 1700003600, "connect": false }
  ]
}
  • Open session (last event connect:true) is counted up to current time when running /playtime.

Limitations

  • Duplicate consecutive connect/disconnect events may occur if the server fires duplicate hooks; playtime calculation tolerates this, but logs may include duplicates.
  • Deleting a player JSON file resets their tracked time.

Roadmap

  • Configurable language without code changes.
  • Optional SQLite backend.
  • Per-world or per-session breakdowns.

License

MIT — see LICENSE.

Enjoy the mod! If you hit issues, open an issue with log snippet and the command you ran.