Minecraft 1.10: Damaged Item Variants Not Working!

minecraft-java-editionminecraft-resource-packs

After watching a YouTube video on how to make a resource pack where the texture of an item is different depending on its damage, I decided to try to try and do it myself. I copied the code, got an image, and made the code for both the image file and the wood sword, which is the item that will have a different texture when damaged. Unfortunately, when I load the resource pack, the item has a "unknown" texture (the black and purple pattern of doom). I'm positive I typed the code right, what did I do wrong?enter image description here

Best Answer

I typed in the exact same things from your screenshot and ran it (i used a golden sword instead of npcArtifact.png, and i called the JSON custom.json instead of npcArtifact.json. Other than that, it's the exact same thing, and it works just fine.

Have you made sure to include npcArtifact.png in assets/minecraft/textures/items? That's where it belongs. Also make sure it's a png, not a renamed gif or jpg. you can make sure by opening it in gimp and exporting it with the appropriate file extension.

Also, your npcArtifact.json should be located at assets/minecraft/models/item. double-check you didn't put it into the textures folder.

Lastly, even though this sounds rediculous, but it happened to me a couple of times (being a resourcepack maker myself): make sure to put the files into the same resourcepack you are loading ingame - e.g. if you load a "respack.zip", but are working with the files inside a folder of your filesystem, make sure you copy them over into respack.zip before starting up minecraft!

hope that helps.

here's what my testfiles look like:

\assets\minecraft\models\item\wooden_sword.json

{
"parent": "item/handheld",
"textures": {
    "layer0": "items/wood_sword"
},
"overrides":[
{"predicate":{"damaged":1,"damage":0.25},
"model":"item/custom"}]
}

\assets\minecraft\models\item\custom.json

{
"parent":"item/handheld",
"textures":{"layer0":"items/gold_sword"}
}

and the texture for the gold_sword is obviously located at \assets\minecraft\textures\items\gold_sword.png which is where your texture should go.