Parts

File location

/assets/minecraft/optifine/cem/**/*.jpm

CEM part files contain the definition of one model part to be referenced in a CEM model file.

Keys

invertAxis

Type: String

Values: Permutation of "xyz"

Optional

Axes to invert: "xyz" inverts the X, Y, Z axes. An empty string inverts none of them and is equal the key being absent.

translate

Type: Array of 3 integers

Optional

Translate (move) the texture by the 3 integers x, y, and z.

rotate

Type: Array of 3 integers

Optional

Rotate (spin) the texture by the 3 integers angle_x, angle_y, and angle_z.

mirrorTexture

Type: String

Values: Subset of "uv"

Optional

Texture axis to mirror. "uv" will mirror both the U and V axis. An empty string mirrors along no axis and is equal the key being absent.

boxes

Type: Array of objects

Optional

Array of part model boxes, as follows.

boxes.textureOffset

Type: Array of 2 integers

Values: [x, y]

Required

Texture offset for the box format.

boxes.uv<FACE>

Type: Array of 4 integers

Values: [u1, v1, u2, v2]

Required

<FACE> is one of Down, Up, North (alias Front), South (alias Back), West (alias Left), or East (alias Right).

UV for face.

boxes.coordinates

Type: Array of 6 integers

Values: [x, y, z, width, height, depth]

Required

Box position and dimensions.

boxes.sizeAdd

Type: Integer

Optional

Size increment added to all dimensions; can be used for asymmetric scaling.

boxes.sizesAdd

Type: Array of 3 integers

Values: [size add x, side add y, side add z]

Optional

Separate size increments can be used for asymmetric scaling.

sprites

Type: Array of objects

Optional

List of 3D sprite models, as follows.

sprites.textureOffset

Type: Array of 2 integers

Values: [x, y]

Required

Texture offset.

sprites.coordinates

Type: Array of 6 integers

Values: [x, y, z, width, height, depth]

Required

Box position and dimensions.

sprites.sizeAdd

Type: Integer

Optional

Size increment added to all dimensions; can be used for asymmetric scaling.

submodel

Type: Self, CEM part object

Optional

A sub-model part; attached to the parent, moving and rotating with it.

submodels

Type: List of CEM part objects

Optional

A list of sub-model parts; 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.webp

The box format UV mapping.

Attachment points

Entities can have items/blocks attached to them. The attachments system allows you to render these items/blocks attached to model parts of your choice.

Attachment name

Supported models

left_handheld_item

allay, armor_stand, drowned, evoker, giant, husk, illusioner, piglin, piglin_brute, pillager, skeleton, stray, vex, vindicator, wither_skeleton, zombie, zombie_villager, zombified_piglin

right_handheld_item

allay, armor_stand, drowned, evoker, giant, husk, illusioner, piglin, piglin_brute, pillager, skeleton, stray, vex, vindicator, wither_skeleton, zombie, zombie_villager, zombified_piglin


Assumes the latest OptiFine & Minecraft versions.
Updated to commit 83d482c3.