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 ORM (through hibernate) support for relational workflows (
ORMContext)
- Java 21
- Velocity
3.5.0-SNAPSHOTand/or Paper API1.21.11-R0.1-SNAPSHOT(compile targets) - 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."));Bukkit/Paper:
RegisteredServiceProvider<DataProviderAPI> registration =
Bukkit.getServicesManager().getRegistration(DataProviderAPI.class);
if (registration == null) {
return;
}
DataProviderAPI api = registration.getProvider();Optional<RelationalDatabaseProvider> mysql = api.registerDatabaseAs(
DatabaseType.MYSQL,
"default",
RelationalDatabaseProvider.class
);
if (mysql.isEmpty() || !mysql.get().isConnected()) {
// Handle unavailable connection
return;
}
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 active connection diagnostics./dataprovider configprints current runtime config state (orm.schema_mode+ backend enablement)./dataprovider reloadreloadsconfig.ymlfrom disk.
Permissions:
dataprovider.command.statusdataprovider.command.configdataprovider.command.reload
- Build or download
DataProvider.jar. - Put it in your server
plugins/directory. - Start once to generate default configuration.
- Configure
plugins/DataProvider/config.ymlandplugins/DataProvider/databases/*.yml.
Coordinates:
groupId:nl.hauntedmc.dataproviderartifactId:dataproviderversion: current release
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</artifactId>
<version>2.0.0</version>
<scope>provided</scope>
</dependency>Gradle (Groovy):
compileOnly "nl.hauntedmc.dataprovider:dataprovider:2.0.0"GitHub Packages authentication details are in the docs.
mvn -q -DskipTests compile
mvn -q test
mvn -B verify
mvn -B -DskipTests checkstyle:check
mvn -B packageBuild output:
target/DataProvider.jar
- 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.