Use a different model for Inventory Icon vs Equipped/In-Hand
This is for 1.21.2+ servers & clients only
If you want to say have an item with a 2D icon in the inventory but when worn on head or held in your hand, it uses a 3D model or another 2D icon, you can do so by following the below
You need to provide an ItemModel that specifies when to show what model.
Here is an example using a mymodel_icon model for the GUI and a "fallback" for everything else.
This approach can be used for most other contexts, which you can find .
This is not a detailed guide on ItemModels, but you can do very complex things with them beyond this.
{
"model": {
"type": "select",
"property": "display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "model",
"model": "namespace:mymodel_icon" // The model to display for the GUI
}
}
],
"fallback": {
"type": "model",
"model": "namespace:mymodel" //The model that is used everywhere else
}
}
}
You can put this inside Nexo/pack/assets/namespace/items/mymodel.json .
Then you can make your NexoItem-config, which will reference this ItemModel
myitem:
itemname: "My Item"
Components:
item_model: namespace:mymodel
Use a blocking json model (for shield)
myitem:
Pack:
model: example_shield.json #json extension is not mandatory
blocking_model: example_shield_blocking.json #json extension is not mandatory