Modern Modpacks
Hellish Mods
Hellish Mods
  • 👋Welcome!
  • 🧊KesseractJS
    • Creating fake mods
  • 💿Modern Custom Discs
    • Adding discs
  • ⌨️Digitality API
    • Introduction
    • Installing and initializing
    • Resource packs
      • Textures
      • Models
      • Sounds
      • Lang files
    • Data packs
      • Recipes
      • Tags
    • Custom assets
  • 🌐Website
  • 🍧Modern Modpacks Docs
Powered by GitBook
On this page
  • Item models
  • Block models
  • One side block model
  1. Digitality API
  2. Resource packs

Models

PreviousTexturesNextSounds

Last updated 2 years ago

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");
⌨️
In-game demonstration
In-game demonstration