Skip to main content
Lode Items builds one resource pack, hosts it and sends it to players. Your plugin can add its own files to that pack, so you don’t need to build, host or send a pack of your own, and players download one pack instead of two. Pack methods are static methods on org.lodemc.api.pack.LodePack.

Adding files

Add a contributor in your plugin’s onLoad. Lode Items calls it every time it builds the pack: when the server starts and on every /lodeitems reload.
Any stack with the item_model component set to myplugin:wand then shows the wand:
If you add a contributor later than onLoad, or your files change, call LodePack.rebuild().
void
Adds a contributor. PackContributor has one method, contribute(PackFiles files), so a lambda works. It’s removed when plugin disables. If a contributor throws an exception, the error is logged and its files are left out; the rest of the pack is still built.
void
Removes every contributor plugin added.
void
Reads items/ again and rebuilds the pack, like /lodeitems reload. The pack is sent again to online players if it changed.

PackFiles

What a contributor writes into. Paths are paths inside the pack, such as assets/myplugin/textures/item/wand.png. Rules for what goes in:
  • Only files under assets/ are used. Lode Items writes pack.mcmeta itself.
  • Lode Items’ own files win a clash. Clashes are logged in the console. Use your own namespace and you won’t have any.
  • Some files are combined instead: sounds.json, and files in lang/, font/ and atlases/, because the game combines those across packs too.
  • The block atlas only reads textures in textures/block/ and the item atlas in textures/item/, so put textures there unless you add an atlas file.
To ship files that owners put in items/ for your plugin, find them with ContentEntry.resolveAsset and add them here. See the spells example.

Reading the pack

Path
The pack as last built, plugins/LodeItems/pack.zip.
String
The SHA-1 of the pack as last built, or null before the first build.
boolean
Whether player’s client has loaded the pack. Bedrock players never have. Use it to show your custom looks only to players who can see them.
PackBuiltEvent fires after every build.