Repository navigation
Composite Model Type
The composite model type allows combining multiple models into one. Each combined model can have conditions and can be translated, scaled, and rotated.
Tip
A description of the emissive, ambient_occlusion, shade_direction_override, and gui_light properties is available on the page for the base model type and for the display and textures
properties on the Minecraft Wiki.
Composite models have the following properties:
| key | values | default | description |
|---|---|---|---|
models |
array of model entries | None | Models that should be combined |
textures |
map of texture keys | None | Specifies materials for texture keys, same as vanilla |
display |
map of transforms | None | Specifies transforms for different tranform types, same as vanilla |
emissive |
true or false
|
false |
Whether the model is emissive |
ambient_occlusion |
true or false
|
true |
Whether the model should be rendered with ambient occlusion |
shade |
true or false
|
true |
Whether the model should be shaded, 26.2 and below only |
shade_direction_override |
up, down, north, east, south, west
|
None | Direction to use for shade, 26.3 and above only |
gui_light |
front, side
|
side |
Lighting to use when the model is rendered in a gui |
| key | values | default | description |
|---|---|---|---|
model |
model data or location of a model |
None | Model to use |
transform |
array of transforms | None | Transformations for the model |
condition |
model predicate or array of model predicates |
true |
Conditions for adding the model |
| key | values | default | description |
|---|---|---|---|
type |
translate, scale, rotate
|
None | Type of transformation |
translation |
array of 3 numbers | None | Offset to apply |
scaling |
number or array of 3 numbers | None | Factors to scale by |
axis |
x, y, z
|
None | Axis to that is rotated around |
angle |
number | None | Angle of rotation in degrees |
origin |
array of 3 numbers | [8,8,8] |
Point to rotate or scale around |
The models property specifies the models that are combine. The list can contain either individual model entries or an array of model entries. For an array of model entries, the first entry for which its condition is met is used.
In the example below:
- the model for cobblestone is always present
- the model for gravel is present if the dimension is the nether
- the model for sand is present if the biome is a desert
- the model for dirt is present if the model is above y=50 and the biome is not a desert
{
"loader": "fusion:model",
"type": "composite",
"models": [
"block/cobblestone",
{
"model": "block/gravel",
"condition": {
"type": "dimension",
"dimension": "the_nether"
}
},
[
{
"model": "block/sand",
"condition": {
"type": "biome",
"biome": "desert"
}
},
{
"model": "block/dirt",
"condition": {
"type": "altitude",
"min_height": 50
}
}
]
]
}Model entries can point to another model file, but they can also directly specify model data.
Here is an example of a model entry with model data:
{
"model": {
"parent": "block/cobblestone",
"textures": {
"particle": "item/iron_ingot"
}
},
"condition": {
"type": "false"
}
}The model data can also be for another Fusion model type:
{
"model": {
"loader": "fusion:model",
"type": "connecting",
"parent": "block/cobblestone",
"connections": {
"default": {
"type": "is_same_block"
}
}
},
"condition": {
"type": "false"
}
}Model entries can use any model predicate as a condition. Check out the model predicates page for more information on the different model predicates.
Here is an example of a model for a fence post that has snow under it if there is a snow layer next to the model:
{
"loader": "fusion:model",
"type": "composite",
"models": [
"block/fence_post",
{
"model": "block/snow_height2",
"condition": {
"type": "match_block",
"block": "snow",
"offsets": [[1,0,0], [0,0,1], [-1,0,0], [0,0,-1]]
}
}
]
}Model entries can apply transforms to translate, scale, and rotate the model. Transforms are applied one after another in the order they are defined.
There is three types of transforms: translate, scale, and rotate.
The translate type offsets the model by given values. Note that the offset is in 1/16th of a block.
The scale type scales the model. Scaling can either be a single value for all axis or 3 individual values. The origin property specifies the point around which the model is scaled and is in 1/16th of a block.
The rotation type rotates the model around a given axis. The angle by which the model is rotated is in degrees. The origin property specifies the point around which the model is rotated and is in 1/16th of a block.
Here is an example of a transform for each of the different types:
| type | example |
|
|
{
"type": "translate",
"translation": [0, 1, 0]
} |
|
|
{
"type": "rotate",
"axis": "y",
"angle": 14,
"origin": [5, 0, 7]
} |
|
|
{
"type": "scale",
"scaling": [1.1, 2, 1.1],
"origin": [8, 0, 8]
} |
Here is an example of a model entry that is moved 2 blocks up and rotated by 5 degrees around the x-axis:
{
"model": "block/cobblestone",
"transform": [
{
"type": "rotate",
"axis": "x",
"angle": 5
},
{
"type": "translate",
"translation": [0, 32, 0]
}
]
}