Simple custom Item - Creating a 'Gem'

Every item, block or entity requires a Behavior file in the bhv folder (to define how the item is going to behave) and a Resource file in the res folder (to define how the item will look in-game).

Let's start off by creating our simple item's behavior file (gem.json) in bhv/items(Create an items folder in the bhv folder). In other words, let's create the behavior in bhv/items/gem.json.

This code it fairly simple.

  • "format_version" defines what format the file uses. We'll be using 1.10;

  • "identifier" in "description" is used in blocks, recipes and entities too. It will be used to define your item. [For example, you can use /give with the identifier like this: /give @s tut:gem).The part of the identifier is your pack's namespace. It's best to use the same namespace throughout your pack. It can be anything you like(e.g "kf:", "jdot:", "ve:", "kai:") providing it isn't too long. A namespace CANNOT be "minecraft:" or "minecon:". The second part of the identifier is the name of the item, entity, recipe or block.

  • "components" are "qualities" the object always has. We'll look deeper into them when creating a custom entity. Let's break up everything in "components".

  • "minecraft:hand_equipped" defines whether the item 'equips' in your hand, this controls how the item is displayed on your character. For example, a Wooden Sword is hand equipped, but an Apple isn't.

  • "minecraft:stacked_by_data" defines whether this item with different aux values will be able to stack. For example, the item "minecraft:dye" with aux value 0, which is an Ink Sack (/give @s dye 1 0), doesn't stack with "minecraft:dye" with aux value 12, which is a Cocoa Bean (/give @s dye 1 12).

  • "minecraft:foil" defines whether the item will have the enchantment glint on it. An enchanted Shovel has this component set to true, but a disenchanted one to false.

  • "max_stack_size" is self-explanatory. Set this to 1 for an unstackable item.

  • "minecraft:max_damage" can be not included, since it's for tools and weapons. It basically defines the item's durability and is rarely used in simple items.

For more information on components you can always refer to the documentation on

If you enter the game now, the item will function, but it will be invisible. Let's fix that by defining it's visuals in the res folder.

Let's copy this code into res/items/gem.json.

  • Set the same "identifier" under "description" as in the item's behavior file.

  • "category" defines the category of items of the item in creative inventory. It can be set to "Nature", "Equipment", "Construction" or "Items".

Note that due to a bug items will not display in the Creative Inventory how they are supposed to, and you'll have to use /give to get them.

Resource components are quite simple:

  • "minecraft:render_offsets" defines how the item should be renders. Can be set to pretty much any Vanilla item name, for example "apple".

  • "minecraft:use_animation" defines what animation to use when the player is using the item(Can be set to "bow", "eat", "drink", "crossbow", "camera"). It isn't needed in simple items, only foods and weapons.

  • And, lastly, "minecraft:icon" defines the item's texture's short name. Let's look more into it.

In order to define your item's texture's shortname(to be able to use the texture on an item), you first need to create the texture. Create a 16*16 image file, draw a gem on it, and save it into res/textures/items as gem.png.

Now let's create the file where texture short names will be defined: res/textures/item_texture.json, and copy this code into it.

  • "resource_pack_name" isn't as important, you can set it to your identifier.

  • Keep "texture_name" as "atlas.items".

In the "texture_data" objects, you'll define all your item texture shortnames.

  • "gem" is the short name for the "textures/items/gem" texture which you drew a few moments ago. This same "gem" is defined in "minecraft:icon" component of the Resource file of your item.

Done! If you did everything correctly, the item will now be obtainable by /give in-game. If you're having trouble, watch your Content Log(settings>profile>enable content log file+enable content log gui). If the item still malfunctions, check my example files at The Guide's files on Git.

Custom food item: - creating an eatable 'Meal';

Creating a food item is very much the same as creating a simple item, except an additional component is needed in the item's behavior file. Let's get started by creating it as bhv/items/meal.json. Here's the code: It looks very similar to the previous item's behaviors.

  • A new item needs a new "identifier", but the same 'namespace'.

  • "minecraft:use_duration" defines how long the player will need to hold the 'use' button in order to consume the food in this scenario;

"minecraft:food" is the component that makes the item a food item. Let's break it up.

  • "nutrition" means hunger points to be added when the player consumes the food.

  • "saturation_modifier" shows how long these will last. Can be set to "poor", "low", "normal", "high", "good", "max" and "supernatural";

  • "can_always_eat" defines if the player can eat the food even if their hunger bar is full. For Golden Apples this component is set to true.

  • "effects" are the status effects to be applied when the player consumes the food. It's pretty self explanatory: when the player consumes this item they'll get Regeneration I for 5 seconds and Resistance III for 120 seconds. This component is optional.

The following code goes in res/items/meal.json, same as last time.

  • "minecraft:use_animation" defines what animation to use when the player is using the item(Can be set to "bow", "eat", "drink", "crossbow", "camera"). It isn't needed in simple items, only foods and weapons.

And, lastly, let's create the texture as res/textures/items/meal.png and set it's shortname to "meal" in res/textures/item_texture.json, the file should now look something like this:

Make sure to check out the current Item documentation for even more components on!

Your items do show up in game, but they have weird names, which consist of their identifiers. For example, tut:gem shows up as To fix this, we need a .lang file in res/texts. If you have US English set as your language in Minecraft settings, you'll need to name your text file en_US.lang. You can find file names for other languages in the example resource pack's texts folder. Paste the following "code" into res/texts/en_US.lang. Now your items will have the correct names.

Your progress so far:

What you've done:

  • Created a simple item;

  • Created a custom food;

  • Learned to link textures using short names in item_textures.json;

  • Learned the basics about components;

  • Learned to define names in the .lang file;

What are you to do next:

  • Create custom blocks;

  • Learn to define flipbook and directional textures;