Parent and Child Models

Child models are models that inherit model properties from existing models, this can reduce file sizes and allows mass changes to all models with one parent rather than having to edit individual files.

To assign a model a parent that it will inherit from simply define the “parent” parameter. Each model can only have one parent.

{
“parent”: “path/model”,

}

There is 4 main things that child models will inherit, these are:
elements
textures
display settings
other parents

Even though a model will inherit these things, they can be overwritten if the child model contains certain aspects of these things.

Inheriting Elements

A child model will inherit elements contained within it’s parent model, this can be used if you need several models that are the same but have different textures, or display settings. If the child model contains any elements the parent model’s elements will be completely overwritten and not appear at all.

Inheriting Textures

Child models will inherit all textures defined under “textures” in the parent model, existing textures can be overwritten inside “textures” in the child model, although the most common use of this is that it will inherit shortcuts allowing for more than one model to have the same elements but with different textures.

Inheriting Display Settings

The display settings for models will be passed on by parents to child models, this saves space in model files, as instead of using the exact same display settings repeated several times across multiple models they can be written once in one model and then passed on via “parent”. These can be overwritten, although each individual display parameter must be overwritten individually.
If a child model inherits “gui”, “head”, and “ground” from a parent, but the child model contains:

“display”: {
“head”: {

}
}

Only “head” display will be overwritten, the child model will still use the display settings for “gui” and “ground” from the parent model.

Inheriting Other Parents

Parent models can be chained through several models, with the normal values being inherited and overwritten as usual.
A common example for this is seen in Minecraft with items. All items will render the same in the gui and on the ground, but tools will be rotated differently when held in the hand.
Tools are child models of “item/handheld” which inherits from “item/generated” but overwrites the display settings when in first person and third person.