Minecraft models are .JSON files that are divided in two:
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.
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.
The first thing we need to know is the differences between the project types:
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:
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:
We also see four numbers at the bottom:
Additionally, we can find another set of icons under the number fields:
This panel is where we have the loaded textures to use in our model, we encounter a some buttons:
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.
This panel has several transform tools for our model, which are:
This panel contains these view options:
· 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.
This panel displays the 3D model.
This has the following information about the selected element:
This panel works as a "layer" list, displaying all elements in our current model, it has the following buttons:
This panel changes the interface mode:
You can modify what buttons show on each panel by clicking on the symbol and pick the ones you need.
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 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: