❗️**The plugin remains fully compatible with data from version 3.1 and later. Before making any modifications, a backup is automatically created, ensuring a seamless and secure migration to the latest version without data loss.** ❗️
---
# **New Features & Improvements**
## Database Migration System
Introduced a comprehensive database migration system allowing seamless switching between database types:
- **New `/playtimemigration` command** – Manage database migrations, available **from console only**.
- **Three subcommands available:**
- `start <dbtype>` – Schedules migration to the specified database type
- `cancel` – Cancels any pending migration
- `status` – Displays current database type and migration status
**Supported database types:**
- MySQL (`mysql`)
- MariaDB (`mariadb`)
- PostgreSQL (`postgresql`)
- SQLite (`sqlite`)
**Migration process:**
- Migration executes automatically on the next server reload/restart after scheduling
- Automatic backup creation before migration begins
- Existing PlayTimeManager tables in target database are automatically dropped to ensure clean migration
- **Important:** Target database credentials must be correctly configured in `config.yml` before server restart (username, password, connection details, etc.)
---
## Expanded Time Unit Support
Added three new time units for placeholders, playtime formats, and commands:
- **`w` (weeks)** – Display playtime in weekly increments
- **`mo` (months)** – Display playtime in monthly increments
- **`mc` (minecraft days)** – Display playtime in Minecraft day units (1 Minecraft day = 20 minutes of real playtime)
**New configuration option:**
- `month-value-in-days` – Customize how many days equal one month for the `mo` unit (defaults to 30 days)
These units can be used anywhere time units are supported, including placeholders, playtime format configurations, and command arguments.
---
## AFK Detection Integration
**JetsAntiAFKPro support** – Integrated JetsAntiAFKPro as an additional AFK detector option.
---
## Configuration Changes
- `distribute-removed-time` option is now set to `true` by default in the default playtime format
# **Bug fixes**
- Fixed `%SUBCOMMAND%` internal placeholder not being correctly parsed
- Fixed automatic update process from some old versions of the plugin
- Fixed `%PTM_rank_<nickname>%` placeholder returning nothing when queried for an offline player
- Fixed an issue which prevented players data up to 5 minutes from being saved correctly to the database on server shut down
- Various optimizations
Developer information
Projects on Modrinth are automatically available through a Maven repository for use with JVM build tools such as Gradle.
maven { name = "Modrinth"; url = "https://api.modrinth.com/maven" }