Build plugins and services, not database plumbing.
DataProvider is shared infrastructure for plugin developers on Velocity and Bukkit/Paper.
It gives you one clean API for MySQL, MongoDB, Redis, and Redis messaging so your plugin code can stay focused on gameplay and business logic.
- Faster development: stop rewriting connection, pooling, and lifecycle code in every plugin.
- Consistent developer experience: same registration and access flow across multiple backends.
- Safer multi-plugin setup: caller-scoped access rules prevent cross-plugin misuse.
- Cleaner codebase: typed APIs reduce casting and repetitive boilerplate.
- Better runtime behavior: connection reuse and lifecycle cleanup are handled centrally.
- Following data backends are implemented:
MYSQL,MONGODB,REDIS,REDIS_MESSAGING - Platform support: Velocity + Bukkit/Paper
- Optional Hibernate ORM support for relational workflows (
nl.hauntedmc.dataprovider.api.orm.ORMContext)
- Java 25
- The currently pinned Paper and Velocity runtime builds (see the root
pom.xml) - MySQL, MongoDB, and/or Redis for the backends you enable
Resolve the API from your platform runtime:
Velocity:
DataProviderAPI api = proxyServer.getPluginManager()
.getPlugin("dataprovider")
.flatMap(container -> container.getInstance()
.filter(DataProviderApiSupplier.class::isInstance)
.map(DataProviderApiSupplier.class::cast)
.map(DataProviderApiSupplier::dataProviderApi))
.orElseThrow(() -> new IllegalStateException("DataProvider is unavailable."))
.forPlugin(this); // bind once during this plugin's initializationBukkit/Paper:
RegisteredServiceProvider<DataProviderAPI> registration =
Bukkit.getServicesManager().getRegistration(DataProviderAPI.class);
if (registration == null) {
return;
}
DataProviderAPI api = registration.getProvider().forPlugin(this); // bind once during onEnableRelationalDatabaseProvider mysql = (RelationalDatabaseProvider) api.registerDatabaseOrThrow(
DatabaseType.MYSQL, "default"
);
api.unregisterDatabase(DatabaseType.MYSQL, "default");If you maintain multiple plugins, this gives your team one standard integration model instead of backend-specific code per project.
/dataprovider helpshows command usage./dataprovider status [summary|connections] [unhealthy] [plugin <name>] [type <databaseType>]shows local state plus cached remote health and its age; it never blocks on remote checks./dataprovider configprints current runtime config state (orm.schema_mode+ backend enablement)./dataprovider reloadvalidates and atomically reloadsconfig.ymlplus everydatabases/*.ymlfile.
Permissions:
dataprovider.command.statusdataprovider.command.configdataprovider.command.reload
- Build or download the bundled platform jar for your server:
dataprovider-platform-paper-*-bundled.jarordataprovider-platform-velocity-*-bundled.jar. - Put it in your server
plugins/directory. - Start once to generate default configuration.
- Configure
plugins/DataProvider/config.ymlandplugins/DataProvider/databases/*.yml.
Use the API artifact in plugins that consume DataProvider. Platform bundles provide it at runtime.
dataprovider-api: public integration contracts, including the ORM context contract and factory; use this for all consumers.dataprovider-core: internal registry, configuration, storage-driver, and ORM implementation details.dataprovider-platform-paper/dataprovider-platform-velocity: server plugin distributions.
Repository:
https://maven.pkg.github.com/HauntedMC/DataProvider
Maven:
<repository>
<id>github</id>
<url>https://maven.pkg.github.com/HauntedMC/DataProvider</url>
</repository><dependency>
<groupId>nl.hauntedmc.dataprovider</groupId>
<artifactId>dataprovider-api</artifactId>
<version>3.0.9</version>
<scope>provided</scope>
</dependency>Gradle (Groovy):
compileOnly "nl.hauntedmc.dataprovider:dataprovider-api:3.0.9"GitHub Packages authentication details are in the docs.
./mvnw -q -DskipTests compile
./mvnw -q test
./mvnw -B -ntp -Pintegration-tests verify
./mvnw -B -ntp -Pplatform-acceptance verifyThe Maven Wrapper pins the build-tool version. The platform-acceptance command requires Docker and boots the bundled Paper and Velocity jars against MySQL, MongoDB, Redis, and Redis messaging. See Testing and CI for the full test matrix and diagnostics.
Build outputs:
dataprovider-platform-paper/target/dataprovider-platform-paper-*-bundled.jardataprovider-platform-velocity/target/dataprovider-platform-velocity-*-bundled.jar
dataprovider-api: stable, platform-neutral contracts, data-access types, and ORM integration surface.dataprovider-core: registry, configuration, storage drivers, and ORM implementation.dataprovider-platform-common: shared lifecycle, command, and logging adapters.dataprovider-platform-paper/dataprovider-platform-velocity: thin platform bootstraps and distributable bundles.
- Documentation index
- Architecture
- Usage guide
- Configuration
- Development
- Testing and CI
- Release process
- Examples
This project is licensed under the GNU Affero General Public License v3.0.