A custom item lives in two packs. The behavior pack says what it does. The resource pack says what it looks like and what it is called. This page covers the resource pack side.
The files
RP/
textures/
item_texture.json
items/
ruby.png
texts/
en_US.langStep 1: the picture
Save a square PNG, usually 16x16, in RP/textures/items/. Keep the background transparent.
Step 2: give it a short name
item_texture.json maps a short name to the PNG. The item file only ever uses the short name.
{
"resource_pack_name": "My Ruby Add-on",
"texture_name": "atlas.items",
"texture_data": {
"ruby": {
"textures": "textures/items/ruby"
}
}
}Leave out the .png at the end of the path. Add one entry per item to the same file.
Step 3: point the item at it
In the behavior pack item, the minecraft:icon component uses the short name:
"minecraft:icon": "ruby"Step 4: the name
The game shows the item's id until you give it a name. Add a line to the language file:
item.wiki:ruby=RubyYou can also skip the language file and set minecraft:display_name in the item itself. The language file is better if you want to translate the add-on later.
Purple and black icon
The short name in minecraft:icon does not match any key in item_texture.json, or the path in textures is wrong. Check the spelling and that the path has no .png.
3D held items
A flat icon is enough for most items. To hold a 3D model in hand or wear one, the resource pack also needs an attachable.