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
  1. Digitality API

Custom assets

Didn't find what you were looking for? Try custom assets. They allow you to add any file to any directory in the virtual pack.

data/resources.customAsset(<Path/File object pointing to the original file>, "<internal file name>", "<subdir 1>", "<subdir 2>", "<subdir 3>"...);
Example
// This code copies the test.png file in the game instance directory and registers it as "funnymod:funny/veryfunny/test.png"
VirtualDataPack data = new VirtualDataPack("funnymod");
data.customAsset(FMLPaths.GAMEDIR.get().resolve("test.png"), "test.png", "funny", "veryfunny");

Note: The first argument can also be an object, the api will automatically convert it into a stringified json.

PreviousTags

Last updated 2 years ago

⌨️