ResourcePackManager API
Generated Java reference includes searchable classes, methods and signatures, with the source version and commit recorded for each module.
ResourcePackManager exposes a Java API that lets other plugins register their resource packs for merging at runtime.
Compile against com.magmaguy:ResourcePackManager:2.4.6 with provided or compileOnly scope, matching the installed plugin. This is the public Maven version checked for this refresh; current source is 2.4.6. The Java API index contains the repository and dependency examples. Declare depend: [ResourcePackManager] for a required integration. This is a Bukkit backend API; proxy plugins cannot use it to register packs on a remote backend.
Accessing the API
The API class is com.magmaguy.resourcepackmanager.api.ResourcePackManagerAPI. All methods are static.
Local pack example
This plugin registers an existing ZIP at plugins/ExamplePack/pack.zip when its descriptor names it ExamplePack. Place the ZIP there before starting the server.
package example;
import com.magmaguy.resourcepackmanager.api.ResourcePackManagerAPI;
import java.io.File;
import org.bukkit.plugin.java.JavaPlugin;
public final class ExamplePack extends JavaPlugin {
@Override
public void onEnable() {
File pack = new File(getDataFolder(), "pack.zip");
if (!pack.isFile()) {
getLogger().warning("Pack registration skipped: pack.zip is missing");
return;
}
ResourcePackManagerAPI.registerLocalResourcePack(
getName(), getDataFolder().getName() + "/pack.zip",
false, false, true, "");
}
}
Registration returns void and replaces any previous registration under the same plugin name. It records a contribution; it does not immediately merge, host or send a pack. If the initial merge has already happened, request a reload once the contribution is ready, or have the administrator run /rspm reload. Avoid starting repeated reloads for every player or file change.
Call registration from the server thread and provide exactly one source. The registration method stores the input without validating that the pack can be downloaded or merged. Check the merge result and server logs when verifying delivery. There is no public unregister method in this facade.
Registering a Resource Pack
There are three registration methods depending on whether your pack is local, remote, or either.
registerResourcePack
ResourcePackManagerAPI.registerResourcePack(
String pluginName,
String localPath,
String url,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack that can come from a local path or a remote URL. Exactly one of localPath or url should be non-null.
registerLocalResourcePack
ResourcePackManagerAPI.registerLocalResourcePack(
String pluginName,
String localPath,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack from a local path relative to the plugins directory.
registerRemoteResourcePack
ResourcePackManagerAPI.registerRemoteResourcePack(
String pluginName,
String url,
boolean encrypts,
boolean distributes,
boolean zips,
String reloadCommand
);
Registers a resource pack that will be downloaded from the provided URL.
Parameters
| Parameter | Description |
|---|---|
pluginName | The name of your plugin exactly as it appears in the plugin list. Case-sensitive. |
localPath | Relative path from the plugins directory to your resource pack file or folder. |
url | URL to download the resource pack from. |
encrypts | Reserved for future use. Currently does nothing. |
distributes | Reserved for future use. Currently does nothing. |
zips | Whether the resource pack is already zipped. If false, ResourcePackManager will zip it before merging. |
reloadCommand | The reload command for your plugin. Reserved for future use. |
Triggering a Reload
ResourcePackManagerAPI.reloadResourcePack();
Reloads ResourcePackManager, which re-merges all registered packs and re-hosts the result if auto-hosting is enabled.
What This API Does Not Cover
Custom Bedrock entities are not registered through this class. A plugin contributes those by shipping native Bedrock entity assets under assets/<namespace>/rspm_bedrock_pack/ inside its Java pack; RSPM carries them into the generated Bedrock pack and the bundled Geyser extension registers the resulting definitions. See Bedrock conversion and Geyser extension & custom entities.
Bedrock conversion hints for items are also pack files rather than API calls: assets/<namespace>/rspm_item_bases/ declares base items, assets/<namespace>/rspm_item_java_only/ keeps items out of Bedrock conversion, and assets/<namespace>/rspm_item_particles/ attaches particles to held items. See Base items, Java-only items and Held-item particles.
Notes
- Packs registered through the API participate in
priorityOrderthe same way built-in integrations do. Add your plugin name topriorityOrderinconfig.ymlto control where it sits in the merge order. - If your plugin name is not listed in
priorityOrder, your pack receives the lowest priority. - Registration should happen during your plugin's
onEnableor initialization, before ResourcePackManager finishes its own initialization and triggers the first merge.