Paper plugin that scans Essentials-like userdata YAML files and exports last-account-name and money to a MySQL/MariaDB table at a configurable interval.
mvn -q -f /home/scala/Desktop/mysqlEssentials/pom.xml packageThe shaded jar will be at target/userdata-exporter-1.0.0.jar.
- Place the jar in your server's
plugins/folder. - Start the server to generate
config.yml.
- Edit
plugins/UserdataExporter/config.yml:database.jdbcUrlexample:jdbc:mysql://localhost:3306/minecraft?useSSL=false&allowPublicKeyRetrieval=true&serverTimezone=UTCdatabase.username/database.passworduserdataPathleave empty to default toplugins/Essentials/userdataexportIntervalSecondsset to 0 to disable periodic exportstableNamedefaultuserdata_export
- On enable, the plugin creates the table if missing and runs an initial export.
- Then, if
exportIntervalSeconds > 0, it runs asynchronously every N seconds. - Each export scans all
*.ymlor*.yamlfiles in theuserdatadirectory. The UUID is derived from the filename.
CREATE TABLE IF NOT EXISTS `userdata_export` (
`uuid` VARCHAR(36) NOT NULL,
`username` VARCHAR(64) NOT NULL,
`money` DECIMAL(18,2) NOT NULL DEFAULT 0,
`updated_at` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (`uuid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;/userdataexport- Manually trigger export (requiresuserdataexport.exportpermission)
debug: true/false- Enable detailed logging for troubleshooting
- Requires MySQL 5.7+/MariaDB 10.2+ for the DDL as written.
- The plugin shades HikariCP and SnakeYAML to avoid classpath issues.