Skip to main content

ResourcePackManager API

ResourcePackManager exposes a Java API that lets other plugins register their resource packs for merging at runtime.

Accessing the API

The API class is com.magmaguy.resourcepackmanager.api.ResourcePackManagerAPI. All methods are static.

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

ParameterDescription
pluginNameThe name of your plugin exactly as it appears in the plugin list. Case-sensitive.
localPathRelative path from the plugins directory to your resource pack file or folder.
urlURL to download the resource pack from.
encryptsReserved for future use. Currently does nothing.
distributesReserved for future use. Currently does nothing.
zipsWhether the resource pack is already zipped. If false, ResourcePackManager will zip it before merging.
reloadCommandThe 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.

Notes

  • Packs registered through the API participate in priorityOrder the same way built-in integrations do. Add your plugin name to priorityOrder in config.yml to 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 onEnable or initialization, before ResourcePackManager finishes its own initialization and triggers the first merge.