Repository navigation
Item Model Modifiers
Item model modifiers are a new concept added by Fusion. They allow overwriting the default model used for an item and allow adding additional models to an item.
Similar to most resource pack features, item model modifiers use json files. The files should be located at assets/<namespace>/fusion/model_modifiers/items/. The name of the file is only relevant for ordering.
Each item model modifier file can target a number of items specified under the targets key.
Here is an overview of the properties of an item model modifier:
| key | values | default | description |
|---|---|---|---|
targets |
array of items | None | Items that the model modifier is applied to |
ignore_missing_targets |
true or false
|
false |
Whether to ignore missing targets, useful for modded items |
priority |
integer | 100 |
Priority used to determine the order in which modifiers are applied, a lower priority is applied first |
default_model_overrides |
array of model entries | None | Overwrites for the default model used for the target items |
append_models |
array of model entries | None | Models that are added to the target items |
| key | values | default | description |
|---|---|---|---|
model |
model data or location of a model |
None | Model to use |
conditions |
model predicate or array of model predicates |
true |
Conditions for using the model |
Each item model modifier file can target a number of items.
Here is an example of a model modifier targeting the Iron Ingot and Copper Ingot items:
{
"targets": [
"iron_ingot",
"copper_ingot"
]
}Default model overwrites can be used to overwrite the model that is used for targeted items. Here is an example of a model modifier that changes the model for Coal to that of Diamond:
{
"targets": [
"coal"
],
"default_model_overrides": [
"item/diamond"
]
}Default model overwrites entries can also have conditions. The conditions can be any item model predicates. The first model in default_model_overrides for which its conditions are met is the model that is used.
Here is an example of a model modifier that changes the model for the Stick to that of the Blaze Rod when the number of items in the stack is greater than 10:
{
"targets": [
"stick"
],
"default_model_overrides": [
{
"model": "item/blaze_rod",
"conditions": {
"type": "count",
"min": 10
}
}
]
}Item model modifiers can add models to targets through the append_models property. Similar to default model overwrites, the appended models can also have conditions.
The property 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 following example:
- the model for the diamond sword is always added
- the model for the golden shovel is added if the item's name is "Digger"
- the model for fire is added if the item is enchanted with fire aspect
- the model for obsidian is added if the item is enchanted with unbreaking and the item is not enchanted with fire aspect
{
"targets": [
"wooden_sword"
],
"append_models": [
"item/diamond_sword",
{
"model": "item/golden_shovel",
"conditions": {
"type": "match_name",
"match_type": "equals",
"text": "Digger"
}
},
[
{
"model": "block/fire",
"conditions": {
"type": "enchantment",
"enchantment": "fire_aspect"
}
},
{
"model": "block/obsidian",
"conditions": {
"type": "enchantment",
"enchantment": "unbreaking"
}
}
]
]
}