🇬🇧 English
🇬🇧 English
Appearance
🇬🇧 English
🇬🇧 English
Appearance
This page is written for version:
1.21.8
This page will guide you through writing your own block models and understanding all their options and possibilities.
Block models are essentially the definition of a block's looks and visuals. They specify a texture, model translation, rotation, scale and other attributes.
Models are stored as JSON files in your resources
folder.
Every block model file has a defined structure that has to be followed. It starts with empty curly brackets, which represent the root tag of the model. Here's a brief scheme of how block models are structured:
{
"parent": "...",
"ambientocclusion": "true/false",
"display": {
"<position>": {
"rotation": [0.0, 0.0, 0.0],
"translation": [0.0, 0.0, 0.0],
"scale": [0.0, 0.0, 0.0]
}
},
"textures": {
"particle": "...",
"<texture_variable>": "..."
},
"elements": [
{
"from": [0.0, 0.0, 0.0],
"to": [0.0, 0.0, 0.0],
"rotation": {
"origin": [0.0, 0.0, 0.0],
"axis": "...",
"angle": "...",
"rescale": "true/false"
},
"shade": "true/false",
"light_emission": "...",
"faces": {
"<key>": {
"uv": [0, 0, 0, 0],
"texture": "...",
"cullface": "...",
"rotation": "...",
"tintindex": "..."
}
}
}
]
}
Set this tag to builtin/generated
to use a model created from the specified icon. Rotation can be achieved via blockstates.
{
"ambientocclusion": "true/false"
}
This tag specifies whether to use ambient occlusion. Defaults to true
.
{
"textures": {
"particle": "...",
"<texture_variable>": "..."
}
}
The textures
tag holds the textures of the model, in the form of an identifier or a texture variable. It contains three additional objects:
particle
: String. Defines the texture to load particles from. This texture is also used as an overlay if you are in a nether portal, and used for water and lava's still textures. Is also considered a texture variable that can be referenced as #particle
.<texture_variable>
: String. Creates a variable and assigns a texture. Can be later referenced with the #
prefix (e.g., "top": "namespace:path"
⇒ #top
)from
specifies the starting point of the cuboid according to the scheme [x, y, z]
, relative to the lower left corner. to
specifies the ending point. A cuboid as big as a standard block would start at [0, 0, 0]
and end at [16, 16, 16]
. The values of both must be between -16 and 32, which means that every block model can be at most 3×3 blocks big.
rotation
defines the rotation of an element. It contains four more values:
origin
: Three floats. Sets the center of the rotation according to the scheme [x, y, z]
.axis
: String. Specifies the direction of rotation, and must be one of these: x
, y
and z
.angle
: Float. Specifies the angle of rotation. Ranges from -45 to 45.rescale
: Boolean. Specifies whether to scale the faces across the whole block. Defaults to false
.uv
: Four integers. Defines the area of the texture to use according to the scheme [x1, y1, x2, y2]
. If unset, it defaults to values equal to xyz position of the element. Flipping the values of x1
and x2
(for example from 0, 0, 16, 16
to 16, 0, 0, 16
) flips the texture. UV is optional, and if not supplied, it's automatically generated based on the element's position.texture
: String. Specifies the texture of the face in the form of a texture variable, prepended with #
.cullface
: String. Can be: down
, up
, north
, south
, west
, or east
. Specifies whether a face does not need to be rendered when there is a block touching it in the specified position. It also determines the side of the block to use the light level from for lighting the face, and if unset, defaults to the side.rotation
: Integer. Rotates the texture clockwise by the specified number of degrees in 90 degree increments. Rotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertices (selected implicitly, or explicitly though uv
).tintidex
: Integer. Tints the texture on that face using a tint value. The default value, -1
, indicates not to use the tint. Any other number is provided to BlockColors
to get the tint value corresponding to that index (returns white when the block doesn't have a tint index defined).You can visit Minecraft Wiki's Block Models page for a more detailed walkthrough. A lot of information here is from that page.