Tutorial - Creation of an item

In this part we're going to add a platinum ingot.

As for the platinum ore, we also create a configuration property for the platinum ingot. Add the following line the mod.js file:

config.addItemIdProperty("platinumIngot", 7000);

It is pretty much the same as for the block except for addItemIdProperty instead of addBlockIdProperty. Also item IDs have to be between 4096 and 31999 (including both).

Let's create the platinum ingot item. Firstly, copy the platinumIngot.png file to the assets/CSTutorial/textures/items directory of your mod's directory.
Now, create a file in the item directory for the attributes of the item. Name it platinumIngot.js and add the following lines to it:

name = "platinumIngot";
id = config.getItemId("platinumIngot");
creativeTab = "materials";
maxStack = 64;

displayName[0] = "Platinum Ingot";
addToCreative[0] = true;
textureFile[0] = "platinumIngot.png";

Items can have up to 32 metadata versions (0 to 31). For example, you can have 32 different ingots in one item file. But notice that damageable items, like tools, can't have metadata versions.

And last but not least, add the item to the mod.js file:

mod.addItem("platinumIngot.js", "normal");

That's it. You'll find the ingot in the materials tab in the creative inventory.
Continue with: Adding a smelting recipe