Models

Since there are multiple different minecraft model types, VirtualResourcePack class has a couple of different methods for each model type.

Item models

resources.itemModel("<item name (diamond/iron_ingot/etc.)>", "<layer1 texture name>", "<layer2 texture name (optional)>", etc...);
Example
// This code generates the "minecraft:item/diamond" model json, that looks something like this:
// {"parent": "minecraft:item/generated", "textures": {"layer0": "minecraft:item/iron_ingot", "layer1": "minecraft:item/stick"}}
VirtualResourcePack resources = new VirtualResourcePack("minecraft");
resources.itemModel("diamond", "iron_ingot", "stick");

Block models

One side block model

resources.blockAllModel("<block name (without the mod id)>", "<resource name (without the mod id)");
// This code overrides the "minecraft:block/gold_block" model, setting it to the "minecraft:block/emerald_block" texture on all sides
VirtualResourcePack resources = new VirtualResourcePack("minecraft");
resources.blockAllModel("gold_block", "emerald_block");

Last updated