|
1 | 1 | # Item - Texture not found |
2 | 2 |
|
3 | | -The item texture shortname you have specificed could not be found in the `item_texture.json` file. |
| 3 | +`behaviorpack.item.components.texture_not_found` |
4 | 4 |
|
5 | | -For example; |
| 5 | +**Severity:** Error |
| 6 | + |
| 7 | +The item texture shortname you have specified could not be found in the `item_texture.json` file of any resource pack in the project, nor in the list of built-in vanilla texture shortnames. |
| 8 | + |
| 9 | +## Trigger conditions |
| 10 | + |
| 11 | +This error is raised in two situations: |
| 12 | + |
| 13 | +### 1. `minecraft:icon` on a behavior pack item |
| 14 | + |
| 15 | +The `minecraft:icon` component supports three formats, and the shortname is checked in each case: |
| 16 | + |
| 17 | +**String shorthand** — the entire value is the texture shortname: |
| 18 | + |
| 19 | +```json |
| 20 | +{ |
| 21 | + "minecraft:icon": "apple" |
| 22 | +} |
| 23 | +``` |
| 24 | + |
| 25 | +**Object with `texture` property** — the `texture` field is the shortname: |
6 | 26 |
|
7 | 27 | ```json |
8 | 28 | { |
9 | | - "minecraft:icon": "apple" |
| 29 | + "minecraft:icon": { |
| 30 | + "texture": "apple" |
| 31 | + } |
10 | 32 | } |
11 | 33 | ``` |
12 | 34 |
|
| 35 | +**Object with `textures` map (per-context textures)** — each value in the `textures` object is checked individually: |
| 36 | + |
| 37 | +```json |
| 38 | +{ |
| 39 | + "minecraft:icon": { |
| 40 | + "textures": { |
| 41 | + "default": "apple", |
| 42 | + "charged": "apple_charged" |
| 43 | + } |
| 44 | + } |
| 45 | +} |
| 46 | +``` |
| 47 | + |
| 48 | +### 2. Spawn egg texture on a resource pack entity |
| 49 | + |
| 50 | +The same diagnostic code is also emitted when a resource pack entity's `description.spawn_egg.texture` references a shortname that cannot be found in `item_texture.json`: |
| 51 | + |
| 52 | +```json |
| 53 | +{ |
| 54 | + "minecraft:client_entity": { |
| 55 | + "description": { |
| 56 | + "identifier": "my_namespace:my_entity", |
| 57 | + "spawn_egg": { |
| 58 | + "texture": "my_entity_spawn_egg" |
| 59 | + } |
| 60 | + } |
| 61 | + } |
| 62 | +} |
| 63 | +``` |
| 64 | + |
| 65 | +## Where the shortname is resolved |
| 66 | + |
| 67 | +The shortname is looked up in the `texture_data` object inside an `item_texture.json` file located in the resource pack: |
| 68 | + |
13 | 69 | ```json |
14 | 70 | { |
15 | 71 | "resource_pack_name": "rp", |
16 | 72 | "texture_name": "atlas.items", |
17 | 73 | "texture_data": { |
18 | 74 | "apple": { |
19 | 75 | "textures": "textures/items/apple" |
| 76 | + }, |
| 77 | + "apple_charged": { |
| 78 | + "textures": "textures/items/apple_charged" |
20 | 79 | } |
21 | 80 | } |
22 | 81 | } |
23 | 82 | ``` |
| 83 | + |
| 84 | +Vanilla built-in texture shortnames (from the Minecraft default resource pack) are also accepted and will **not** trigger this error. |
| 85 | + |
| 86 | +## How to fix |
| 87 | + |
| 88 | +1. **Check for typos** in the shortname used in `minecraft:icon` (or `spawn_egg.texture`) and correct any misspellings. |
| 89 | +2. **Add the missing entry** to your resource pack's `item_texture.json` under `texture_data`, mapping the shortname to a texture path. |
| 90 | +3. **Verify the file location** — the `item_texture.json` file must be placed at `textures/item_texture.json` inside a resource pack that is included in your project. |
| 91 | +4. If you intended to reuse an existing vanilla texture, **check the vanilla shortname** matches exactly (shortnames are case-sensitive). |
0 commit comments