How To Make A Resource Pack V

Models & Blockstates

Basic Structure

Minecraft models are .JSON files that are divided in two:

  • Blocks - which models are located in \assets\minecraft\models\block
  • Items - which models are located in \assets\minecraft\models\item

As mentioned before, models are stored in .JSON files, so let's take a look at one of them. For this example, I created a 1x1x1 cube with no texture.

{
 "elements": [
  {
   "from": [0, 0, 0],
   "to": [1, 1, 1],
   "faces": {
    "north": {"uv": [0, 0, 1, 1], "texture": "#"},
    "east": {"uv": [0, 0, 1, 1], "texture": "#"},
    "south": {"uv": [0, 0, 1, 1], "texture": "#"},
    "west": {"uv": [0, 0, 1, 1], "texture": "#"},
    "up": {"uv": [0, 0, 1, 1], "texture": "#"},
    "down": {"uv": [0, 0, 1, 1], "texture": "#"}
   }
  }
 ]
}

The attribute "from" declares the bottom corner of the cube, in this case X=0 Y=0 Z=0. The attribute "to" declares the top corner of the cube, in this case X=1 Y=1 Z=1. The attribute "faces" contains all the faces the model currently has. The valid faces are north, east, south, west, up, and down. The attribute "uv" declares what coordinate ranges in the texture will be applied to the specified face. The first 0 and 0 are the top left starting coordinates and the 1 and 1 are the bottom right ending coordinates. The attribute "texture" declares the path to the texture applied to the specified face.

The texture can also be a variable, to do this, we need to add the following attribute: {
 "textures": {
  "particle": "block/my_texture",
  "custom_name": "block/my_texture"
 },
 "elements": [
  {
   "from": [0, 0, 0],
   "to": [1, 1, 1],
   "faces": {
    "north": {"uv": [0, 0, 1, 1], "texture": "#custom_name"},
    "east": {"uv": [0, 0, 1, 1], "texture": "#custom_name"},
    "south": {"uv": [0, 0, 1, 1], "texture": "#custom_name"},
    "west": {"uv": [0, 0, 1, 1], "texture": "#custom_name"},
    "up": {"uv": [0, 0, 1, 1], "texture": "#custom_name"},
    "down": {"uv": [0, 0, 1, 1], "texture": "#custom_name"}
   }
  }
 ]
}

The attribute "textures" declares all the textures used in the model and allows to asign a variable name to them. The variable name "particle" is hard-coded and is used for the breaking particles of the model. In this case is the same as the model. The path "block/..." specifies the path to a texture with \assets\minecraft\textures\ as the starting point.

Aside from these attributes, there're a lot more that can be used, one of the attributes you'll find a lot when browsing Minecraft files is the "parent" attribute, which specifies when the model is based on another model, this saves space when models are the same but only the texture changes.
{
 "parent": "minecraft:block/cube_all",
 "textures": {
  "all": "minecraft:block/acacia_planks"
 }
}

In this example, the acacia planks block uses the "cube_all.json" model, which is a 16x16x16 cube, and just changes the texture to "acacia_planks.png".

Now that we understand the basics, we can make this whole process more simple by using a program called Blockbench.

Blockbench

Basics

The first thing we need to know is the differences between the project types:

  • Generic Model: is a good option for rendering and more complex models. Not usable in Minecraft.
  • Java Block/Item: this is the one we'll be using for most models.
  • Bedrock Model: is the Bedrock Edition alternative.
  • Modded Entity: is used to model entities for mods.
  • Optifine Entity: is used to model entities for Optifine resource packs.

Once we know what we're aiming for (in our case, Java Block/Item), we can create our project. This will prompt the following window:

Format: declares what type of project we're working with.

File Name: declares the name of our model.

Parent Model: in case we have a parent model, we can specify it here.

Ambient Occlusion: toggles Ambient Occlusion ON and OFF.

UV Mode: allows us to pick from "Per-face UV" and "Box UV". The first one is for blocks/items and the second one is for entities.

Texture Size: declares the size in pixels of the texture that's going to be used, being the first field X and the second one Y.

After setting this up, our project will be created and we'll have access to our workspace:

UV

This panel is where we're going to have all the tools to manipulate the UV Map of our model.
Within this panel, we have several buttons at the top:

  • North: controls the north face UV. When we click it, we'll get the controls for it.
  • East: controls the east face UV. When we click it, we'll get the controls for it.
  • South: controls the south face UV. When we click it, we'll get the controls for it.
  • West: controls the west face UV. When we click it, we'll get the controls for it.
  • up: controls the up face UV. When we click it, we'll get the controls for it.
  • Down: controls the down face UV. When we click it, we'll get the controls for it.

We also see four numbers at the bottom:

  • The first two control the X and Y position of the face over the texture.
  • The last two control the X and Y size of the face over the texture.

Additionally, we can find another set of icons under the number fields:

  • applies the current settings to all faces.
  • extends the selected UV to the border.
  • automatically sets the UV depending on the model.
  • disables the selected faces and prevent their rendering.
  • rotates the UV 90º.
  • flips the UV horizontally.
  • flips the UV vertically.
  • resets the UV to its initial settings.
  • defines the a grid on the UV window.
  • prevents render of selected faces when they are not visible (cullface).
  • rotates around the UV 90º.
  • rotates the UV to the left.
  • rotates the UV to the right.
  • sets cullface to for the selected faces to themselves.
  • toggles tint for the selected face.
  • determines whether to tint the texture using a hardcoded tint index.
  • snaps UV to the texture pixels.
  • selects both the texture and the UV at the same time.

TEXTURES

This panel is where we have the loaded textures to use in our model, we encounter a some buttons:

  • loads a texture.
  • opens the 'Create Texture' window, which creates a placeholder texture.
  • adds the selected elements as a template to the selected texture.
  • saves the texture.
  • changes the texture location.
  • plays an animated texture.
  • creates a slider to control the frames for animated textures.
  • displays the frames per second of an animated texture.
  • inverts colors for the selected texture.
  • adjusts brightness for the selected texture.
  • adjusts saturation and hue for the selected texture.
  • adjusts color curves for the selected texture.
  • flips texture horizontally.
  • flips texture vertically.
  • resizes the texture.
  • flashes faces without a texture.

It is also posible to assign a texture for the breaking particles, to do that, simply right click the texture, and select 'Use for Particles'. You should now see the symbol, which confirms that is the particle texture now.

TRANSFORM

This panel has several transform tools for our model, which are:

  • move model mode.
  • resize model mode.
  • rotate model mode.
  • move pivot mode.
  • snap to vertex mode.

VIEW

This panel contains these view options:

  • View Mode (Textured - Solid - UV - Wireframe)
  • Shading (ON - OFF).
  • Preview.
  • · Screenshot Model - takes a screenshot of the viewport.
    · Preview Checkerboard - toggles background checkerboard.
    · Background - allows you to load and render a background.
    · Center View on Selection - sets the camera pivot to the selected element.
    · Save Angle - saves current view angle to the 'Angles' dropdown.
    · Angles - displays a dropdown with predefined view angles.
    · Orthographic - toggles between perspective and orthographic views.
    · Quad View - splits the viewport in four, each partition is a different view.

VIEWPORT

This panel displays the 3D model.

ELEMENT

This has the following information about the selected element:

  • Position - controls the position on the X, Y, and Z coordinates of the model.
  • Size - controls the size on the X, Y, and Z coordinates of the model.
  • Pivot Point - controls the pivot point on which rotations will be applied.
  • Rotation - controls the rotation on the X, Y, and Z coordinates relative to the pivot point.
  • resizes the element.
  • sets the pivot to the center of mass.
  • resizes the model on rotation.
  • sets the transform mode to rotation.
  • flips the selected element on the X axis.
  • flips the selected element on the Y axis.
  • flips the selected element on the Z axis.
  • centers the selected element.

OUTLINER

This panel works as a "layer" list, displaying all elements in our current model, it has the following buttons:

  • toggles visibility of the selected element.
  • locks the selected element.
  • duplicates the selected element.
  • unlocks all elements.
  • inverts the current element selection.
  • selects all elements.
  • creates an element group.
  • collapses selected groups.
  • unfolds selected groups.

MODE

This panel changes the interface mode:

  • Edit Mode - allows to edit the model and its elements.
  • Paint Mode - allows to edit the texture and paint on the model.
  • Display Mode - controls how the model displays in several situations.

You can modify what buttons show on each panel by clicking on the symbol and pick the ones you need.

Making A Model

For the sake of this guide, I'll make a 3D furnace. Now the first thing we want to do is set up our project, so let's do that.

1. Open Blockbench and create a project for a Java Block/Item.

2. Now, we create a new cube by pressing the button or using the shortcut CTRL+N.

3. Let's resize the cube we created to 16x16x16, for this, we can use both the element size fields on the top right or press S to display the resize controls.

4. We're going to apply a texture to this cube. To do that, we can click on the button or use CTRL+T.

5. Now, we can drag the texture to each face to apply it, dragging the texture onto the UV window, or right clicking the cube and selecting a texture.

6. This will be our reference model. Let's being creating the basic shape for our 3D version.

7. We now have our shape, but textures are still missing. Let's switch to the North view by pressing 6 and start adding textures.

8. Do the same for all the faces...

9. Remove the reference model since we won't need it anymore.

10. We need to optimize the faces that are not being shown. We can do this manually by selecting the face and clicking the button, or automatically by installing a plugin (see step 11).

11. To install the optimizer plugin, "click on File > Plugins..." When a window opens, head over to "Available" and search for "Optimizer" and proceed to install it. Select all the cubes you want to optimize (in our case, all) and click "Tools > Optimize".

12. Now we need to adjust the display settings of the model. To do that, click "Display" on the top right.

13. As you can see, it looks disproportioned. To fix this we can click on and select the "Default Block" option, then apply to all slots. This will make the display the same as most blocks in all instances.

14. Hit CTRL+S to save and place the .JSON file in \assets\minecraft\models\block\furnace.json.

And there we go, we made a custom furnace 3D model!

Blockstates

Blockstates are extra pieces of data that further define a block depending on their state. They are stored as a .JSON file at \assets\minecraft\blockstates\ and can be used to assign a model to a certain condition.
Let's use "oak_log.json" for this example:
{
 "variants": {
  "axis=x": {
   "model": "minecraft:block/oak_log_horizontal",
   "x": 90,
   "y": 90
  }
 }
}

This file is defining that when the state "axis=X" state is true, the game will use the model "oak_log_horizontal.json" then rotate it 90 degrees on the x axis and 90 degrees on the y axis.

The multiple states a block can have can be checked in-game by pressing F3 and looking at a block. On the right side we'll find this information: