Automatic update checking and configuration management library for Minecraft plugins.
- Modrinth Update Checker - Automatic update detection from Modrinth.
- Version Comparison - Semantic versioning support.
- Config Auto-Update - Version-tracked configuration file updates.
- Smart Backups - Only creates backups when meaningful changes are detected.
- Rich Notifications - Formatted console and in-game update messages.
- User Preservation - Keeps user customizations during config updates.
- Daily Limits - Prevents notification spam, once per day per player.
<repositories>
<repository>
<id>jitpack</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>com.github.NighterDevelopment</groupId>
<artifactId>PluginUpdateCore</artifactId>
<version>1.0.4</version>
<scope>compile</scope>
</dependency>
</dependencies>repositories {
maven("https://jitpack.io")
}
dependencies {
implementation("com.github.NighterDevelopment:PluginUpdateCore:1.0.4")
}Preview the update log layout:
./gradlew printUpdateLogOn Windows:
.\gradlew.bat printUpdateLogimport io.github.pluginupdatecore.updater.UpdateChecker;
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
// Find your project ID at: https://modrinth.com/plugin/YOUR_PROJECT
new UpdateChecker(this, "YOUR_MODRINTH_PROJECT_ID");
}
}Update notifications are not blocked by Modrinth server-version metadata. If an update is newer than the installed plugin version, the console and eligible operators can still be notified.
import io.github.pluginupdatecore.updater.ConfigUpdater;
public class MyPlugin extends JavaPlugin {
@Override
public void onEnable() {
ConfigUpdater configUpdater = new ConfigUpdater(this);
configUpdater.checkAndUpdateConfig();
reloadConfig();
}
}- Fetches all versions from the Modrinth API.
- Finds the latest release version.
- Compares the latest version with the current plugin version.
- Displays a console notification when an update is available.
- Sends in-game notifications to operators once per day.
========================================================================
UPDATE AVAILABLE
========================================================================
Plugin : PluginUpdateCore
Current version : 1.0.4
Latest version : 1.1.0
Download : https://modrinth.com/plugin/example/version/1.1.0
========================================================================
- Adds a
config_versionkey toconfig.yml. - Compares the file version with the plugin version.
- Loads current user configuration and bundled defaults.
- Creates a timestamped backup when meaningful changes are detected.
- Merges user values with new defaults.
- Saves the updated configuration and reloads the plugin config.
- Go to your plugin page on Modrinth.
- Look at the URL:
https://modrinth.com/plugin/YOUR_PROJECT_ID. - The project ID is the slug after
/plugin/.
| Method | Description |
|---|---|
new UpdateChecker(plugin, projectId) |
Initialize and start checking |
checkForUpdates() |
Manually check for updates asynchronously |
isUpdateAvailable() |
Check if an update is available |
getLatestVersion() |
Get latest version string |
getDownloadUrl() |
Get Modrinth download page URL |
getDirectLink() |
Get direct JAR download URL |
isServerVersionSupported() |
Always returns true; compatibility gating has been removed |
| Method | Description |
|---|---|
new ConfigUpdater(plugin) |
Create updater instance |
checkAndUpdateConfig() |
Check and update config if needed |
getCurrentVersion() |
Get current plugin version |
getConfigVersionKey() |
Get version key name (config_version) |
| Method | Description |
|---|---|
new Version(string) |
Parse version string |
compareTo(other) |
Compare versions |
isNewerThan(other) |
Check if newer |
isOlderThan(other) |
Check if older |
isEqualTo(other) |
Check if equal |
getMajor() |
Get major version number |
getMinor() |
Get minor version number |
getPatch() |
Get patch version number |
getBuild() |
Get build version number |
- Minecraft 1.21+
- Java 21+
- Paper or compatible forks
This library is licensed under the MIT License. See LICENSE for details.