Model

From Minecraft Wiki
Jump to navigation Jump to search
See also: Tutorials/Models
This feature is exclusive to Java Edition. 

Models are three-dimensional shapes used in Minecraft that are used to display objects encountered in the game.

The models pertaining to the vast majority of blocks and items can be configured, as well as those of a small selection of entities. Models are stored as JSON files in a resource pack in the assets/<namespace>/models folder.

Block models[edit | edit source]

  • The root tag
    •  parent: Loads a different model from the given path, in form of a resource location. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the previous model.
      • Can be set to "builtin/generated" to use a model that is created out of the specified icon. Note that only the first layer is supported, and rotation can be achieved only by using block states files.
    •  ambientocclusion: Whether to use ambient occlusion (true - default), or not (false).
    •  display: Holds the different places where item models are displayed.
      •  Position: Named thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, firstperson_lefthand, gui, head, ground, or fixed. Place where an item model is displayed. Holds its rotation, translation and scale for the specified situation. fixed refers to item frames, while the rest are as their name states. Note that translations are applied to the model before rotations.
        •  rotation: Specifies the rotation of the model according to the scheme [x, y, z].
        •  translation: Specifies the position of the model according to the scheme [x, y, z]. The values are clamped between -80 and 80.
        •  scale: Specifies the scale of the model according to the scheme [x, y, z]. If the value is greater than 4, it is displayed as 4.
    •  textures: Holds the textures of the model, in form of a resource location or can be another texture variable.
      •  particle: What 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.[1] This texture is also considered a texture variable that can be referenced as "#particle". Note: All breaking particles from non-model blocks are hard-coded, such as for barriers.
      •  Texture variable: Defines a texture variable and assigns a texture.
    •  elements: Contains all the elements of the model. They can have only cubic forms. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the previous model.
      • An element.
        •  from: Start point of a cuboid according to the scheme [x, y, z]. Values must be between -16 and 32.
        •  to: Stop point of a cuboid according to the scheme [x, y, z]. Values must be between -16 and 32.
        •  rotation: Defines the rotation of an element.
          •  origin: Sets the center of the rotation according to the scheme [x, y, z].
          •  axis: Specifies the direction of rotation, can be "x", "y" or "z".
          •  angle: Specifies the angle of rotation. Can be 45 through -45 degrees in 22.5 degree increments.
          •  rescale: Specifies whether or not to scale the faces across the whole block. Can be true or false. Defaults to false.
        •  shade: Defines if shadows are rendered (true - default), not (false).
        •  faces: Holds all the faces of the cuboid. If a face is left out, it does not render.
          •  Face: Named down, up, north, south, west or east. Contains the properties of the specified face.
            •  uv: Defines the area of the texture to use according to the scheme [x1, y1, x2, y2]. The texture behavior is inconsistent if UV extends below 0 or above 16. If the numbers of x1 and x2 are swapped (e.g. from 0, 0, 16, 16 to 16, 0, 0, 16), the texture flips. UV is optional, and if not supplied it automatically generates based on the element's position.
            •  texture: Specifies the texture in form of the texture variable prepended with a #.
            •  cullface: Specifies whether a face does not need to be rendered when there is a block touching it in the specified position. The position can be: down, up, north, south, west, or east. 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: Rotates the texture clockwise by the specified number of degrees. Can be 0, 90, 180, or 270. Defaults to 0. Rotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertexes (selected implicitly, or explicitly though uv).
            •  tintindex: Determines whether to tint the texture using a hardcoded tint index. 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. However, most blocks do not have a tint value defined (in which case white is used). Furthermore, no vanilla block currently uses multiple tint values, and thus the tint index value is ignored (as long as it is set to something other than -1); it could be used for modded blocks that need multiple distinct tint values in the same block though.

Item models[edit | edit source]

  • : The root tag
    •  parent: Loads a different model from the given path, in form of a resource location. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the previous model.
      • Can be set to "item/generated" to use a model that is created out of the specified icon.
      • Can be set to "builtin/entity" to load a model from an entity file. As you cannot specify the entity, this does not work for all items (only for chests, ender chests, mob heads, shields, banners and tridents).
    •  display: Holds the different places where item models are displayed.
      •  Position: Named thirdperson_righthand, thirdperson_lefthand, firstperson_righthand, firstperson_lefthand, gui, head, ground, or fixed. Place where an item model is displayed. Holds its rotation, translation and scale for the specified situation. fixed refers to item frames, while the rest are as their name states. Note that translations are applied to the model before rotations. If this is specified but not all of translation, rotation and scale are in it, the others aren't inherited from the parent.
        •  rotation: Specifies the rotation of the model according to the scheme [x, y, z].
        •  translation: Specifies the position of the model according to the scheme [x, y, z]. If the value is greater than 80, it is displayed as 80. If the value is less than -80, it is displayed as -80.
        •  scale: Specifies the scale of the model according to the scheme [x, y, z]. If the value is greater than 4, it is displayed as 4.
    •  textures: Holds the textures of the model, in form of a resource location or can be another texture variable.
      •  layerN: Used only to specify the icon of the item used in the inventory. There can be more than just one layer (e.g. for spawn eggs), but the amount of possible layers is hardcoded for each item. Works only in combination with "item/generated".
      •  particle: What texture to load particles from. Used to determine the "crumb" particles generated by food items, as well as to determine the barrier particle (but it always uses items/barrier.png as blockbreaking particle), which otherwise uses "layer0".
      •  Texture variable: Defines a texture variable and assigns a texture.
    •  gui_light: Can be "front" or "side". If set to "side", the model is rendered like a block. If set to "front", model is shaded like a flat item. Defaults to "side".
    •  elements: Contains all the elements of the model. They can have only cubic forms. If both "parent" and "elements" are set, the "elements" tag overrides the "elements" tag from the parrent model.
      • An element.
        •  from: Start point of a cuboid according to the scheme [x, y, z]. Values must be between -16 and 32.
        •  to: Stop point of a cuboid according to the scheme [x, y, z]. Values must be between -16 and 32.
        •  rotation: Defines the rotation of an element.
          •  origin: Sets the center of the rotation according to the scheme [x, y, z].
          •  axis: Specifies the direction of rotation, can be "x", "y" or "z".
          •  angle: Specifies the angle of rotation. Can be 45 through -45 degrees in 22.5 degree increments.
          •  rescale: Specifies whether or not to scale the faces across the whole block. Can be true or false. Defaults to false.
        •  shade: Defines if shadows are rendered (true - default) or not (false).
        •  faces: Holds all the faces of the cuboid. If a face is left out, it does not render.
          •  Face: Named down, up, north, south, west or east. Contains the properties of the specified face.
            •  uv: 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. The texture behavior is inconsistent if UV extends below 0 or above 16. If the numbers of x1 and x2 are swapped (e.g. from 0, 0, 16, 16 to 16, 0, 0, 16), the texture flips. UV is optional, and if not supplied it automatically generates based on the element's position.
            •  texture: Specifies the texture in form of the texture variable prepended with a #.
            •  cullface: Specifies whether a face does not need to be rendered when there is a block touching it in the specified position. The position can be: down, up, north, south, west, or east. 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: Rotates the texture by the specified number of degrees. Can be 0, 90, 180, or 270. Defaults to 0. Rotation does not affect which part of the texture is used. Instead, it amounts to permutation of the selected texture vertexes (selected implicitly, or explicitly though uv).
            •  tintindex: Determines whether to tint the texture using a hardcoded tint index. Tint indexes are hard coded into an item and each tint index represents a different color (as defined in the item class). Note that only certain blocks/items have a tint index; all others remain unaffected.
    •  overrides: Determines cases in which a different model should be used based on item tags. All cases are evaluated in order from top to bottom and last predicate that matches overrides. However, overrides are ignored if it has been already overridden once, for example this avoids recursion on overriding to the same model.
      • A case.
        •  predicate: Holds the cases.
          •  Case A single case tag. See item predicates for a full list of available tags.
        •  model: The path to the model to use if the case is met, in form of a resource location.

Uses of models[edit | edit source]

Non-hardcoded models are used in-game in the following contexts:

Use case Uses Image Respects shade=false?
Blocks
Placed blocks All blocks excluding those listed here Yes
Falling blocks All blocks excluding those listed here Yes
Piston-moved blocks All blocks excluding those listed here Yes
Lit TNT TNT No
Items
Items in the inventory All items excluding air No
Items in the player's hand (first person) All items excluding air[verify] No
Items in the player's hand (third person)
Items held by other players
Items held by mobs
All items excluding air[verify] No
Items on the ground All items excluding air No
Items in item frames All items excluding air No
Totem of undying animation Totem of undying No[verify]

Objects that cannot be remodelled[edit | edit source]

This section is missing information about: Objects needing testing:
  • Trident
  • Bell
  • Is the shield model hardcoded and non-customizable, even if the shield item definition isn't required to point to it?. 
Please expand the section to include this information. Further details may exist on the talk page.

While most blocks and items can have their model changed, there are a multitude of things that cannot.

For example, no entities (with the exception of item frames and glow item frames) can have their model changed in Java Edition with resource packs alone.

Blocks and fluids[edit | edit source]

Block Reason
The block is hardcoded to be invisible. Despite having empty physical model data, defining such a model does not change it.
The block renders as an entity would. As of 1.20.1, all entity models besides item frames and glow item frames remain hardcoded.
In addition to using an entity model, these blocks use a layering system to define textures.
This is a highly technical block which is only used in specific circumstances, with its own special rendering method.
These blocks utilize a "starfield" effect which is incompatible with the functionality of models.
Fluid rendering is hardcoded and their handling differs significantly from blocks.

Even these blocks (with the exception of the three air variants)[2] have particle textures defined in dedicated model files, however it still stands that actual visual models cannot be changed.

Sub-elements of blocks, such as passively emitted particles and the book on top of the enchanting table, cannot be modified, even though the base block can.

History[edit | edit source]

This article needs to be updated. 
Please update this page to reflect recent updates or newly available information.
Reason:
  • When were "texture overlays" like those used for a grass block added and removed? Pretty sure is in 14w25a, since that version made the sides of grass blocks its own element
  • Nearly everything after 1.9 is missing
Java Edition pre-Classic
?Blocks exist, however their models are completely hardcoded, and as such cannot be configured outside of modding.
Java Edition
1.814w06aAdded custom block models.
14w07aThe model format has now been rewritten. Instead of having just "planes", it now has "planes" and "cubes".
The rotation of objects are now limited to one directional rotation per object in increments of 22.5 degrees.
14w11aLighting on solid block no longer makes inner sections completely black.
14w11bGeneric blocks now load models instead of pre-defined shapes.
April 12, 2014TheMogMiner posts about upcoming changes to the model format.
14w17aConverted most of the remaining static blocks to the model format.
Added "rotateVariantTextures" to preserve uv details through rotation.
14w25aThe directional attribute from the uv definition has now been removed and replaced it with explicit texture references. "textureFacing" has been replaced with "texture" parameter, which is now prepended with the hash symbol (#).
"useAmbientOcclusion" has now been renamed to "ambientocclusion".
"rotateVariantTextures" has now been renamed to "UV lock".
"cull" has now been renamed to "cullface", specifies the opposite of which neighboring face causes culling to occur.
Rotation has now been made more verbose, it is now more clear that it can occur only on a single axis. Example, the rotation for one of the two faces of the "cross" model is now: "rotation": { "origin": [ 8, 8, 8 ], "axis": "y", "angle": 45, "rescale": true },.
The folder models/blocks/meshes has now been removed and model files are now stored in models/block.
The folder blockstates has now been added and stores the model selection files previously found in models/block.
The model format now supports custom item models.
14w27aBlock state names have now been replaced with data that better reflects the internal data. This does not yet reflect all data for some blocks and switches to using the actual stored data in a future version when numerical data values are completely dropped in favor of block states.
14w27bThe block state files now support an array of models allowing for random models.
14w30aAdded the item model "builtin/entity".
1.8.2pre5The tag "translation" is now limited to the range of -24 to 24.
The tag "scale" is now limited to 4 or less.
1.915w31aUV is now optional, and if not supplied it automatically generates based on the element's position.
Added different models/textures for different damage values, item states, and whether the player is left handed. This works on compasses, clocks, and anything that can have a durability bar. It also contains additional tags for bows and fishing rods.
Models can now be put together based on block state attributes, such as fences. As a result, the vanilla set of block models was reduced by almost 300 models.
Block model JSON is now strict, comments and quoteless identifiers are now not allowed.
"display" tag defaults have now been changed, and the "thirdperson" and "firstperson" tags have now been replaced with "thirdperson_righthand", "thirdperson_lefthand", "firstperson_righthand", and "firstperson_lefthand".
"parent" and "elements" tags can now coexist, though the top level elements tag overwrites all former ones.
The option to disable alternate block models has now been removed.
Multipart tag functionality added.
1.1418w43aAdded the item model property "custom_model_data".
1.15.2Pre-Release 1The gui_light parameter for item models has been added.

References[edit | edit source]

Navigation[edit | edit source]