ItemsModels & CustomModelData
Last updated
Last updated
In the new versions of Minecraft they changed things about the CustomModelData and now they are located in the items folder, this allows adding a component in the item to change its model.
This is a new component added in 1.21.3
, but in 1.21.4
it has been modified, is a way to use an different from those already created or modifying the existing ones, in this case the component references to assets/<namespace>/items/<id>
and would be used as <namespace>:<id>
๐ฆresource_pack.zip
โโโ ๐assets
โโโ ๐minecraft
โโโ ๐items
โโโ ๐๐some_item.json
In 1.21.3 referenced to assets/<namespace>/models/item/<id>
/give @p diamond[item_model='minecraft:some_item'] 1
๐ฆresource_pack.zip
โโโ ๐assets
โโโ ๐minecraft
โโโ ๐items
โ โโโ ๐diamond.json
โโโ ๐models
โโโ ๐item
โโโ ๐awesome_item.json
diamond.json
{
"model": {
"type": "minecraft:range_dispatch",
"property": "minecraft:custom_model_data",
"entries": [
{
"threshold": 1382,
"model": {
"model": "minecraft:item/awesome_item",
"type": "minecraft:model"
}
}
],
"scale": 1,
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/diamond"
}
}
}
/give @p diamond[custom_model_data={floats:[1382]}] 1
{
"model": {
"type": "minecraft:range_dispatch",
"property": "minecraft:custom_model_data",
"entries": [
{
"threshold": 1381,
"model": {
"property": "select",
"type": "minecraft:display_context",
"cases": [
{
"when": [
"gui",
"fixed"
],
"model": {
"type": "minecraft:model",
"model": "minecraft:item/diamond_pickaxe"
}
},
{
"when": [
"thirdperson_lefthand",
"thirdperson_righthand",
"ground",
"none"
],
"model": {
"type": "minecraft:model",
"model": "minecraft:item/diamond_sword"
}
}
]
}
},
{
"threshold": 1382,
"model": {
"model": "minecraft:item/awesome_item",
"type": "minecraft:model"
}
}
],
"scale": 1,
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/stone_sword"
}
}
}
๐ฆresource_pack.zip
โโโ ๐assets
โโโ ๐minecraft
โ โโโ ๐items
โ โโโ ๐apple.json
โโโ ๐elitefantasy
โโโ ๐models
โ โโโ ๐custom
โ โโโ ๐items
โ โโโ ๐food
โ โโโ๐apple_rotated_to_mouth.json
โ โโโ ๐apple_eat_1.json
โ โโโ ๐apple_eat_2.json
โ โโโ ๐apple_eat_3.json
โ โโโ ๐apple_eat_4.json
โ โโโ ๐apple_eat_5.json
โ โโโ ๐apple_eat_6.json
โโโ ๐textures
โโโ ๐custom
โโโ ๐items
โโโ ๐food
โโโ ๐จapple_eat_1.png
โโโ ๐จapple_eat_2.png
โโโ ๐จapple_eat_3.png
โโโ ๐จapple_eat_4.png
โโโ ๐จapple_eat_5.png
โโโ ๐จapple_eat_6.png
apple.json
{
"model": {
"type": "minecraft:select",
"property": "minecraft:display_context",
"cases": [
{
"when": "gui",
"model": {
"type": "minecraft:model",
"model": "minecraft:item/apple"
}
}
],
"fallback": {
"type": "minecraft:condition",
"property": "minecraft:using_item",
"on_false": {
"type": "minecraft:model",
"model": "minecraft:item/apple"
},
"on_true": {
"type": "minecraft:range_dispatch",
"property": "minecraft:use_duration",
"remaining": true,
"scale": 1,
"entries": [
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_6"
},
"threshold": 2
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_5"
},
"threshold": 6
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_4"
},
"threshold": 10
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_3"
},
"threshold": 14
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_2"
},
"threshold": 18
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_1"
},
"threshold": 22
},
{
"model": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_rotated_to_mouth"
},
"threshold": 26
}
],
"fallback": {
"type": "minecraft:model",
"model": "elitefantasy:custom/items/food/apple_eat_6"
}
}
}
}
}
This would be an example with Christmas
{
"model": {
"type": "minecraft:range_dispatch",
"property": "minecraft:custom_model_data",
"entries": [
{
"threshold": 1382,
"model": {
"type": "minecraft:select",
"pattern": "MM-dd",
"property": "minecraft:local_time",
"cases": [
{
"model": {
"type": "minecraft:model",
"model": "minecraft:item/some_item_christmas"
},
"when": [
"12-24",
"12-25",
"12-26"
]
}
],
"fallback": {
"model": {
"type": "minecraft:model",
"model": "minecraft:item/some_item"
}
}
}
}
],
"scale": 1,
"fallback": {
"type": "minecraft:model",
"model": "minecraft:item/diamond"
}
}
}
custom_model_data Component Tutotial !