I am making a datapack that adds several new weapon types to the game. The model loads and works correctly, but for some reason the texture does not load and instead shows the black-and-pink missing texture. Here's how I have my files set up:
assets v
minecraft v
models v
item
textures
item
Inside "item" folder under "textures" is the "daggerwood.png" file. no capitals, no spaces, so that's not the issue.
inside the "models" folder is the base item I'm using and it's file.
In the model.json file, I needed to put "item/" before "daggerwood" to dictate in which directory to find the image file. Hopefully anybody having this issue finds this post to help fix it!
Actually for 1.21
I am making a datapack that adds several new weapon types to the game. The model loads and works correctly, but for some reason the texture does not load and instead shows the black-and-pink missing texture. Here's how I have my files set up:
assets v
minecraft v
models v
item
textures
item
Inside "item" folder under "textures" is the "daggerwood.png" file. no capitals, no spaces, so that's not the issue.
inside the "models" folder is the base item I'm using and it's file.
wooden_sword.json:
{
"parent": "item/handheld",
"textures": {
"layer0": "item/wooden_sword"
},
"overrides": [
{ "predicate": {"custom_model_data": 411001}, "model": "item/wooden_dagger"}
]
}
Also, the custom model:
wooden_dagger.json:
{
"credit": "Made with Blockbench",
"textures": {
"0": "daggerwood.png",
"particle": "daggerwood.png"
},
"elements": [
{
"from": [10, 0, 3],
"to": [13, 1, 4],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [13, 3, 10, 4], "texture": "#0"},
"east": {"uv": [12, 3, 13, 4], "texture": "#0"},
"south": {"uv": [10, 3, 13, 4], "texture": "#0"},
"west": {"uv": [10, 3, 11, 4], "texture": "#0"},
"up": {"uv": [10, 3, 13, 4], "texture": "#0"},
"down": {"uv": [10, 3, 13, 4], "texture": "#0"}
}
},
{
"from": [0, 0, 13],
"to": [3, 1, 16],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [3, 13, 0, 14], "texture": "#0"},
"east": {"uv": [0, 13, 3, 14], "texture": "#0"},
"south": {"uv": [0, 15, 3, 16], "texture": "#0"},
"west": {"uv": [0, 14, 3, 15], "texture": "#0"},
"up": {"uv": [0, 13, 3, 16], "texture": "#0"},
"down": {"uv": [0, 16, 3, 13], "texture": "#0"}
}
},
{
"from": [2, 0, 12],
"to": [4, 1, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [4, 12, 2, 13], "texture": "#0"},
"east": {"uv": [3, 12, 4, 13], "texture": "#0"},
"south": {"uv": [2, 12, 4, 13], "texture": "#0"},
"west": {"uv": [2, 12, 3, 13], "texture": "#0"},
"up": {"uv": [2, 12, 4, 13], "texture": "#0"},
"down": {"uv": [2, 12, 4, 13], "texture": "#0"}
}
},
{
"from": [3, 0, 13],
"to": [4, 1, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [3, 13, 4, 14], "texture": "#0"},
"east": {"uv": [3, 13, 4, 14], "texture": "#0"},
"south": {"uv": [3, 13, 4, 14], "texture": "#0"},
"west": {"uv": [3, 13, 4, 14], "texture": "#0"},
"up": {"uv": [3, 13, 4, 14], "texture": "#0"},
"down": {"uv": [3, 13, 4, 14], "texture": "#0"}
}
},
{
"from": [3, 0, 10],
"to": [5, 1, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [3, 10, 5, 11], "texture": "#0"},
"east": {"uv": [3, 11, 5, 12], "texture": "#0"},
"south": {"uv": [3, 11, 5, 12], "texture": "#0"},
"west": {"uv": [5, 11, 3, 12], "texture": "#0"},
"up": {"uv": [3, 10, 5, 12], "texture": "#0"},
"down": {"uv": [3, 12, 5, 10], "texture": "#0"}
}
},
{
"from": [4, 0, 12],
"to": [5, 1, 13],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [4, 12, 5, 13], "texture": "#0"},
"east": {"uv": [4, 12, 5, 13], "texture": "#0"},
"south": {"uv": [4, 12, 5, 13], "texture": "#0"},
"west": {"uv": [4, 12, 5, 13], "texture": "#0"},
"up": {"uv": [4, 12, 5, 13], "texture": "#0"},
"down": {"uv": [4, 12, 5, 13], "texture": "#0"}
}
},
{
"from": [5, 0, 12],
"to": [7, 1, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [0, 0, 2, 1], "texture": "#0"},
"east": {"uv": [0, 0, 2, 1], "texture": "#0"},
"south": {"uv": [5, 12, 7, 13], "texture": "#0"},
"west": {"uv": [5, 12, 7, 13], "texture": "#0"},
"up": {"uv": [5, 11, 7, 13], "texture": "#0"},
"down": {"uv": [5, 11, 7, 13], "texture": "#0"}
}
},
{
"from": [7, 0, 12],
"to": [8, 1, 14],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [7, 13, 8, 14], "texture": "#0"},
"east": {"uv": [7, 12, 8, 14], "texture": "#0"},
"south": {"uv": [7, 12, 8, 13], "texture": "#0"},
"west": {"uv": [6, 13, 8, 14], "texture": "#0"},
"up": {"uv": [7, 12, 8, 14], "texture": "#0"},
"down": {"uv": [7, 12, 8, 14], "texture": "#0"}
}
},
{
"from": [5, 0, 10],
"to": [7, 1, 12],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"east": {"uv": [5, 11, 7, 12], "texture": "#0"},
"south": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"west": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"up": {"uv": [5, 10, 7, 12], "texture": "#0"},
"down": {"uv": [5, 12, 7, 10], "texture": "#0"}
}
},
{
"from": [5, 0, 8],
"to": [7, 1, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [7, 8, 5, 9], "texture": "#0"},
"east": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"south": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"west": {"uv": [5, 8, 7, 9], "texture": "#0"},
"up": {"uv": [5, 8, 7, 10], "texture": "#0"},
"down": {"uv": [5, 10, 7, 8], "texture": "#0"}
}
},
{
"from": [2, 0, 9],
"to": [5, 1, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [2, 9, 5, 10], "texture": "#0"},
"east": {"uv": [0, 0, 1, 1], "texture": "#missing"},
"south": {"uv": [0, 0, 3, 1], "texture": "#missing"},
"west": {"uv": [2, 9, 3, 10], "texture": "#0"},
"up": {"uv": [2, 9, 5, 10], "texture": "#0"},
"down": {"uv": [2, 10, 5, 9], "texture": "#0"}
}
},
{
"from": [2, 0, 10],
"to": [3, 1, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [3, 10, 4, 11], "texture": "#0"},
"east": {"uv": [3, 10, 4, 11], "texture": "#0"},
"south": {"uv": [3, 10, 4, 11], "texture": "#0"},
"west": {"uv": [3, 10, 4, 11], "texture": "#0"},
"up": {"uv": [3, 10, 4, 11], "texture": "#0"},
"down": {"uv": [3, 10, 4, 11], "texture": "#0"}
}
},
{
"from": [2, 0, 8],
"to": [4, 1, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [2, 8, 4, 9], "texture": "#0"},
"east": {"uv": [3, 8, 4, 9], "texture": "#0"},
"south": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"west": {"uv": [2, 8, 3, 9], "texture": "#0"},
"up": {"uv": [2, 8, 4, 9], "texture": "#0"},
"down": {"uv": [2, 8, 4, 9], "texture": "#0"}
}
},
{
"from": [7, 0, 8],
"to": [9, 1, 10],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"east": {"uv": [9, 9, 7, 10], "texture": "#0"},
"south": {"uv": [7, 9, 9, 10], "texture": "#0"},
"west": {"uv": [0, 0, 2, 1], "texture": "#missing"},
"up": {"uv": [7, 8, 9, 10], "texture": "#0"},
"down": {"uv": [7, 10, 9, 8], "texture": "#0"}
}
},
{
"from": [7, 0, 10],
"to": [8, 1, 11],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [7, 10, 8, 11], "texture": "#0"},
"east": {"uv": [7, 10, 8, 11], "texture": "#0"},
"south": {"uv": [7, 10, 8, 11], "texture": "#0"},
"west": {"uv": [7, 10, 8, 11], "texture": "#0"},
"up": {"uv": [7, 10, 8, 11], "texture": "#0"},
"down": {"uv": [7, 10, 8, 11], "texture": "#0"}
}
},
{
"from": [9, 0, 8],
"to": [10, 1, 9],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [9, 8, 10, 9], "texture": "#0"},
"east": {"uv": [9, 8, 10, 9], "texture": "#0"},
"south": {"uv": [9, 8, 10, 9], "texture": "#0"},
"west": {"uv": [9, 8, 10, 9], "texture": "#0"},
"up": {"uv": [9, 8, 10, 9], "texture": "#0"},
"down": {"uv": [9, 8, 10, 9], "texture": "#0"}
}
},
{
"from": [6, 0, 7],
"to": [11, 1, 8],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [6, 7, 11, 8], "texture": "#0"},
"east": {"uv": [10, 7, 11, 8], "texture": "#0"},
"south": {"uv": [6, 7, 11, 8], "texture": "#0"},
"west": {"uv": [6, 7, 7, 8], "texture": "#0"},
"up": {"uv": [6, 7, 11, 8], "texture": "#0"},
"down": {"uv": [6, 7, 11, 8], "texture": "#0"}
}
},
{
"from": [7, 0, 6],
"to": [12, 1, 7],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [7, 6, 12, 7], "texture": "#0"},
"east": {"uv": [11, 6, 12, 7], "texture": "#0"},
"south": {"uv": [7, 6, 12, 7], "texture": "#0"},
"west": {"uv": [7, 6, 8, 7], "texture": "#0"},
"up": {"uv": [7, 6, 12, 7], "texture": "#0"},
"down": {"uv": [7, 6, 12, 7], "texture": "#0"}
}
},
{
"from": [8, 0, 5],
"to": [13, 1, 6],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [8, 5, 13, 6], "texture": "#0"},
"east": {"uv": [12, 5, 13, 6], "texture": "#0"},
"south": {"uv": [8, 5, 13, 6], "texture": "#0"},
"west": {"uv": [8, 5, 9, 6], "texture": "#0"},
"up": {"uv": [8, 5, 13, 6], "texture": "#0"},
"down": {"uv": [8, 5, 13, 6], "texture": "#0"}
}
},
{
"from": [9, 0, 4],
"to": [13, 1, 5],
"rotation": {"angle": 0, "axis": "y", "origin": [7, 0.5, 9]},
"faces": {
"north": {"uv": [9, 4, 13, 5], "texture": "#0"},
"east": {"uv": [12, 4, 13, 5], "texture": "#0"},
"south": {"uv": [9, 4, 13, 5], "texture": "#0"},
"west": {"uv": [9, 4, 10, 5], "texture": "#0"},
"up": {"uv": [9, 4, 13, 5], "texture": "#0"},
"down": {"uv": [9, 4, 13, 5], "texture": "#0"}
}
}
],
"display": {
"thirdperson_righthand": {
"rotation": [45, 0, 90],
"translation": [-7.5, 6, 1.75]
},
"thirdperson_lefthand": {
"rotation": [-45, 0, 90],
"translation": [-7.5, -8.75, 2.75]
},
"firstperson_righthand": {
"rotation": [0, 0, 90],
"translation": [-8.75, 4, 2.5]
},
"firstperson_lefthand": {
"rotation": [-90, 0, 90],
"translation": [-7.25, -4, 9.25]
},
"ground": {
"rotation": [90, 0, 0],
"translation": [3, 6.75, 7.25]
},
"gui": {
"rotation": [90, 0, 0],
"translation": [0.5, 0.5, 0]
},
"fixed": {
"rotation": [90, 0, 0],
"translation": [2, 2, 8]
}
},
"groups": [
{
"name": "group",
"origin": [11, 0, 4],
"color": 0,
"children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19]
}
]
}
I've uploaded an image below of the issue.
Update: I have also replaced all of the "missing"s with #0. Also not the problem.
AHA! Problem solved!
In the model.json file, I needed to put "item/" before "daggerwood" to dictate in which directory to find the image file. Hopefully anybody having this issue finds this post to help fix it!