org.lodemc.api.pack.LodePack.
Adding files
Add a contributor in your plugin’sonLoad. Lode Items calls it every time it builds the pack: when the server starts and on every /lodeitems reload.
item_model component set to myplugin:wand then shows the wand:
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 asassets/myplugin/textures/item/wand.png.
Rules for what goes in:
- Only files under
assets/are used. Lode Items writespack.mcmetaitself. - 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 inlang/,font/andatlases/, because the game combines those across packs too. - The block atlas only reads textures in
textures/block/and the item atlas intextures/item/, so put textures there unless you add an atlas file.
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.