Loading Item Definitions
Loading ItemDefinitions
Item Definitions are one of the more complex assets, as you CAN autoload them, however in case you dont do that, it takes upto 3 lines to set it up.
public class MyResourcePack {
public static void load(Plugin plugin) {
ResourcePack pack = new ResourcePack(plugin, "plugin_id");
Namespace ns = pack.namespace("plugin_id");
tex = ns.texture("item/iron_sword");
Model model = ns.model("item/iron_sword", true);
/* OR
Model model = ns.model("item/iron_sword", false)
mod.parent("minecraft:item/generated");
mod.texture("layer0", tex); */
Selector.Model sel = new Selector.Model(model);
ns.itemDefinition("iron_sword", sel, false);
pack.register(false);
}
}
The ResourcePack API provides much more than just this, for example you can load mcmeta files, icon, pack mcmeta, waypoint styles, and much more, however not EVERYTHING is contained, some files you will have to load manually using JsonAsset as an example, report missing stuff on discord or github issues and ill be adding it all!
03 October 2025