Pack Structure

This page will explain how Java Edition resource packs are structured, and therefores gives an idea of how to create your first resource pack from scratch.

Overview

1📦Root
2 ┣ 📂assets
3 ┃ ┣ 📂minecraft
4 ┃ ┃ ┣ 📂blockstates
5 ┃ ┃ ┣ 📂font
6 ┃ ┃ ┣ 📂icons
7 ┃ ┃ ┣ 📂lang
8 ┃ ┃ ┣ 📂models
9 ┃ ┃ ┃ ┣ 📂block
10 ┃ ┃ ┃ ┗ 📂item
11 ┃ ┃ ┣ 📂particles
12 ┃ ┃ ┣ 📂resourcepacks
13 ┃ ┃ ┣ 📂shaders
14 ┃ ┃ ┃ ┣ 📂post
15 ┃ ┃ ┃ ┗ 📂program
16 ┃ ┃ ┣ 📂sounds
17 ┃ ┃ ┣ 📂texts
18 ┃ ┃ ┣ 📂textures
19 ┃ ┃ ┗ 📜sounds.json
20 ┣ 📜pack.mcmeta
21 ┗ 📜pack.png

Root Items

These items are not in any folder of the resource pack. It is important to note when compressing a resource pack that these items should be compressed at the same level as the assets folder. A compressed resource pack will not load if compressed from the enclosing folder.

pack.mcmeta

Files of the extension .mcmeta use the JSON syntax. Here is an excerpt of this file from the vanilla pack:

1{
2 "language": {
3 "en_us": {
4 "region": "US",
5 "name": "English",
6 "bidirectional": false
7 }
8 },
9 "pack": {
10 "description": "The default look and feel of Minecraft",
11 "pack_format": 6
12 }
13}

Though this example defines languages, this is not nesscescary unless defining a new language. The main section with which the average user should be concerned is the highlighted lines above, which specify the description of the pack visible in the resource pack switcher, and the pack format. Pack format is based on the Minecraft version with which the pack is compatible.

Currently, valid values for pack_format are:

  • 1: 1.6.1 to 1.8.9
  • 2: 1.9 to 1.10.2
  • 3: 1.11 to 1.12.2
  • 4: 1.13 to 1.14.4
  • 5: 1.15 to 1.16.1
  • 6: 1.16.2 to 1.16.5
  • 7: 1.17 to 1.17.1
  • 8: 1.18 to 1.18.2
  • 9: 1.19 to 1.19.2
  • 11: 22w42a to 22w44a
  • 12: 1.19.3 and above

pack.png

The pack.png should be a square image, though non-square images will be stretched to conform to a square proportion. Any resolution is acceptable.

Assets

The assets folder contains all of the packs media assets. It encloses the namespace folders.

Namespaces

Namespaces are a rarely utilized feature of Java Editon resource packs. The namespace folders exist immediately after the assets folder. The default namespace is minecraft, which is the most commonly utilized. To reference assets from a specific namespace in a resource pack when specifying a file path, the path is prefixed with the namepace and a colon.

Take the following parented model:

1{
2 "textures": {
3 "1": "minecraft:block/acacia_log",
4 "2": "item/acacia_boat",
5 "3": "custom:item/custom_texture"
6 },
7 "parent": "custom:block/custom_model"
8}

In the above example, the full paths at which assets would be referenced is as follows:

  • Texture "1" would resolve to /assets/minecraft/textures/block/acacia_log.png
  • Texture "2" would resolve to /assets/minecraft/textures/item/acacia_boat.png
  • Texture "3" would resolve to /assets/custom/textures/item/acacia_boat.png
  • The parent would resolve to /assets/custom/models/block/custom_model.json

Block States

Block states are the properties held by placed blocks. Common examples of blockstates are facing and type, for example, of which facing species the direction that a block faces, and type specifies whether a slab is top, bottom, or double. Block states are defined by the JSON files held in the blockstates folder. Different block states or combonations of block states can correspond to different models, as well as axis rotations.

Font

The font folder contains the configuration information for fonts. This includes glyph_sizes.bin, defining the widths of characters used for the unicode font. Three JSON files, uniform.json, default.json, and alt.json, are present in the default pack. The file alt.json lists the provider exclusively for the enchantment table font, while uniform.json exclusively lists the provider for the legacy unicode font. The file default.json can be used to define new main fonts. These can be of the type bitmap, utilized by Minecraft's default font, or ttf for TrueType fonts. Bitmap fonts are stored in a subfolder of textures, while TureType fonts are stored directly in this font folder.

Icons

The icons folder contains the application icons for Minecraft. These icons, however, cannot be pulled directly from a resource pack at this time.

Lang

The lang folder contains JSON values that consist of key-value pairs in which the key is the identifier for some string used in the game, and the value is the string when that language file is applied. Language files are generalled named with a two letter contry code seperated by an underscore from a two letter language code.

Models

The models folder holds the JSON files that create the games models. These JSON files are constructed with four main fields, textures, elements, display, and parent. They can be described as follows:

  • textures maps texture paths to shortnames which can be referenced by the faces of elements
  • elements defined all the cubes in the model, their sizes, positions, and textues and UV values of each face
  • display sets the appearance of a model in terms of scale, position, and rotation for different slots and perspectives, as well as item drops, item frames, and GUI
  • parent, when specified, pulls any of the non-specified previous fields from the specified parent model

Particles

The particles folder contains a JSON file for each particle that specifies an array of textures for the given particle. These textures must be present in the particle subfolder of the textures folder. When multiple textures are defined for a single particle, this produces a framewise animated particle texture.

Resourcepacks

The resourcepacks folder of the default resource pack contains programmer_art.zip, which provides the legacy Minecraft textures. Like the icons folder, this cannot currently be utilized by custom resource packs.

Shaders

The shaders folder is comprised of three subfolders, core, post, and program. In general, shaders affect how the game is rendered.

Program

The program subfolder is comprised of JSON files that specifcy a vertex and fragment shader.

Post

The post subfolder contains shaders written in GLSL, Open GL Shader Language, in the form of vertex shaders (.vsh) and fragment shaders (.fsh). Vertex shaders are applied to all vertexes, the point where the corners of planes intersect, while fragment shaders are applied to each pixel.

Core

The core subfolder defines shader programs that are directly utilized by the game.

Sounds

The sounds folder contains all the sounds for the game. This folder does not ship with the version JAR, and must be extracted from the hashed assets in the assets folder of the Minecraft folder. All sounds are of the OGG format and use the Vorbis audio codec. These sounds are triggered in game by sound events defined in sounds.json, which exists in the namespace folder, above the sounds folder. Events can contain mutliple sounds from which a random sound will be chosen. Weight, volume, and pitch can also be controlled on a per event basis. A subtitle event can also be defined for each sound event, the value of which can then be specified in a language file.

Texts

The texts folder contains three plain text files with the extension .txt, credits.txt, end.txt, and splashes.txt. The file credits.txt contains the game scrolling credits and utilize book-style color codes with the § symbol. The end.txt file defines a poem that scrolls when the Enderdragon is defeated, and also uses color codes.The final file, splashes.txt, does not utilize color codes. It specifies the random phrases that appear on the start game splash screen.

Textures

The textures folder contains all game textures. Textures must utilize the png format. In previous versions, textures were required to be square. This is no longer the case. Textures sometimes are accompanied by .mcmeta files that specify texture animation. These folders take the full filename of the texture with extensions, followed by .mcmeta.

 Page Contributors
Kas-tle