Fix a purple and black missing texture in a Minecraft mod
The purple and black checkerboard is the game’s missing texture. It means the model points at a PNG the game cannot find. A model says ‘mymod:item/ruby’ and the game looks for assets/mymod/textures/item/ruby.png: the mod id before the colon, ‘textures/’ added for you, ‘.png’ added for you. Check the spelling, the lowercase file name, the folder and that the PNG is 16x16 or a power of two. The log names the exact path it could not find.
Works on Minecraft 1.20.1 to 26.3 on NeoForge; Minecraft 1.16.5 to 26.3 on Fabric; Minecraft 1.16.5 to 1.20.1 on Forge; Minecraft 1.12.2 on Forge. Each example was compiled against its loader and version before it shipped in Linen.
- Search logs/latest.log for ‘Unable to load model’ or ‘Missing textures in model’. It prints the path it wanted.
- Make the PNG’s path match: assets/<mod id>/textures/item/<name>.png for an item, textures/block/ for a block.
- Use lowercase letters, digits and underscores only, in the file and in the model.
- Check the model file in assets/<mod id>/models/item (or block) points at ‘mod_id:item/name’ with no ‘.png’.
- Rebuild or reload resources with F3+T.
For each loader and version
Section titled “For each loader and version”The example mod is examplemod in the package com.example.examplemod. Use your own mod id and package.
Fabric and NeoForge 1.20.4 to 1.21.1, NeoForge 1.20.1 to 1.20.2, Fabric 1.16.5 to 1.20.3, Fabric and NeoForge 1.21.2 to 26.3, Forge 1.16.5 to 1.20.1
Section titled “Fabric and NeoForge 1.20.4 to 1.21.1, NeoForge 1.20.1 to 1.20.2, Fabric 1.16.5 to 1.20.3, Fabric and NeoForge 1.21.2 to 26.3, Forge 1.16.5 to 1.20.1”Uses:
textures/itemmodels/itemminecraft:item/generated
src/main/resources/assets/examplemod/models/item/ruby_gem.json
{ "parent": "minecraft:item/generated", "textures": { "layer0": "examplemod:item/ruby_gem" }}Forge 1.12.2
Section titled “Forge 1.12.2”Uses:
textures/itemsmodels/itemitem/generated
1.12.2 keeps item textures in textures/items and block textures in textures/blocks (plural).
src/main/resources/assets/examplemod/models/item/ruby_gem.json
{ "parent": "item/generated", "textures": { "layer0": "examplemod:items/ruby_gem" }}Sources
Section titled “Sources”- https://docs.fabricmc.net/1.21.1/develop/items/first-item
- https://docs.neoforged.net/docs/1.21.1/resources/client/textures
- https://docs.neoforged.net/docs/1.21.1/resources/client/models/
Related how-tos
Section titled “Related how-tos”- A block with a different texture on each side
- A texture for an item or block
- A crafting recipe
- A furnace recipe
- A new block
In Linen
Section titled “In Linen”Linen’s How-tos library has this page too, with the example for your own mod’s loader and Minecraft version. Hover a name in your code and Linen points to the how-tos that explain it. Both are free. Download Linen.