> For the complete documentation index, see [llms.txt](https://wiki.modernmodpacks.site/wiki/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.modernmodpacks.site/wiki/hellish-mods/digitality/custom-assets.md).

# 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.

```java
data/resources.customAsset(<Path/File object pointing to the original file>, "<internal file name>", "<subdir 1>", "<subdir 2>", "<subdir 3>"...);
```

{% code title="Example" %}

```java
// 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");
```

{% endcode %}

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