Models#

../_images/icon_models.png

3D model in Blockbench#

Reference configuration for OptiFine’s feature Custom Entity Models. This file contains the definition of one model part and it can be referenced as "model" from the entity model. The file extension .jpm is recommended, but not required.

It should be located in the assets/minecraft/optifine/cem/ folder of the resource pack.

These properties are required:

  • "textureOffset", or individual face UV

  • "coordinates"

Key

Values

Meaning

texture

String, path to texture

Texture used by entity model

textureSize

Array of integers: [width, height]

Texture size in pixels

invertAxis

String combination of [x, y, z]

Axes to invert: ‘xyz’ inverts the X, Y, and Z axes, ‘’ inverts none of them

translate

Array of integers: [x, y, z]

Translate texture by x, y, z

rotate

Array of integers: [angle_x, angle_y, angle_z]

Rotation texture by angle_x, angle_y, angle_z

mirrorTexture

String combination of [u, v]

Texture axis to mirror, 'uv' mirror both the U and V axis, '' mirrors none

boxes

List…

List of part model boxes

boxes→textureOffset

List of integers: [u, v]

Texture offset for box format, see model_box.png

boxes→uv<face>

List of strings: [u1, v1, u2, v2]

UV for face <face>, where <face> is one of: Down, Up, North, South, West, East

boxes→coordinates

List of integers: [x, y, z, width, height, depth]

Box position and dimensions

boxes→sizeAdd

Integer

Size increment (added to all dimensions), can be used for asymmetric scaling

sprites

List…

List of 3D sprite models, depth 1

sprites→textureOffset

List of integers: [u, v]

Texture offset, in pixels

sprites→coordinates

List of integers [x, y, z, width, height, depth]

Box position and dimensions

sprites→sizeAdd

Integer

Size increment (added to all dimensions), can be used for asymmetric scaling

submodel or submodels

Sub-model or List of sub-models

Sub-model or list of sub-models; attached to the parent, moving and rotating with it

Texture UV#

Warning

Texture UV cannot have both specifications, either "textureOffset", or uv<face>; not both

Texture UV can be specified in box format with:

  • "textureOffset" or

  • "uvDown", "uvUp", "uvNorth", "uvSouth", "uvWest", and "uvEast".

../_images/model_box.png

The box format UV mapping#

Texture locations#

Note

The texture suffix “.png” is optional.

Path

Direction

texture

No / in name, look in current folder

./folder/texture

Relative to current folder

~/folder/texture

Relative to folder assets/minecraft/optifine

folder/texture

Relative to folder assets/minecraft/

mod:folder/texture

Relative to folder assets/mod/

Reference JSON#

Warning

This is not a valid JSON format and it should only be used as a reference

{
  "texture": <texture.png>,
  "textureSize": [<width>, <height>],
  "invertAxis": <axis_to_invert>,
  "translate": [<x>, <y>, <z>],
  "rotate": [<angle_x>, <angle_y>, <angle_z>],
  "mirrorTexture": <axis_to_mirror>,
  "boxes":  [
  {
      "textureOffset": [<u>, <v>],
      "uvDown": [<u1>, <v1>, <u2>, <v2>],
      "uvUp": [<u1>, <v1>, <u2>, <v2>],
      "uvNorth": [<u1>, <v1>, <u2>, <v2>],
      "uvSouth": [<u1>, <v1>, <u2>, <v2>],
      "uvWest": [<u1>, <v1>, <u2>, <v2>],
      "uvEast": [<u1>, <v1>, <u2>, <v2>],
      "coordinates": [<x>, <y>, <z>, <width>, <height>, <depth>],
      "sizeAdd": <size_add>
    }
  ],
  "sprites": [
    {
      "textureOffset": [<u>, <v>],
      "coordinates": [<x>, <y>, <z>, <width>, <height>, <depth>],
      "sizeAdd": <size_add>
    }
  ],
  "submodel": {
  }
  "submodels": [
    { }
  ]
}

🆚️ This documentation assumes the latest OptiFine version. Notes are not made for legacy versions (1.8).
🔙️ This documentation is updated to commit 8410499f.
©️ This file is offered without any copyright restrictions. Please copy and modify it to suit your needs. Credit is optional, but appreciated.