Basic Modding - Armor


I want to show you how to create a armor set and how to add potion effects if the armor is worn.


3/10 - Relatively Easy


Forge Version

This Tutorial was created with Forge for Minecraft 1.7.10. If anything doesn't work with other versions, please contact me!

The Armor Material

As well as we had to add a ToolMaterial for custom tools, we need to add an ArmorMaterial for custom armor. To do this, we'll use the EnumHelper again. This is the code for adding an ArmorMaterial:

public static ArmorMaterial ARMOR = EnumHelper.addArmorMaterial("NAME", durability, damageReduction[], enchantability);

This method takes the following arguments:


  • A unique name for the material. This should be the same as the variable's name, but you can choose another one.
  • The durability of the armor item. This value is multiplicated with the following list to generate the different durabilities for each armor item:
    durability * 11 for the helmet
    durability * 16 for the chestplate
    durability * 15 for the leggings
    durability * 13 for the boots
    Common values for the durability are:
    • 5 for leather armor
    • 15 for chain and iron armor
    • 7 for gold armor
    • 33 for diamond armor
  • The damageReductionArray of the armor. This is a list of integer values that define the number of armor points for helmet, chestplate, leggings and boots that are added to the player's hotbar when the armor is worn. These values should be adjusted carefully because if you use higher values than the diamond armor has, the armor bar is overfilled. The additional armor points are not rendered but show their effect: If a player has got 25 armor points, he becomes invulnerable. A feature like this sould not be added by any mod!
    Common values for the damage reduction array are:
    • new int[]{1, 3, 2, 1} for leather armor (7 at all)
    • new int[]{2, 5, 4, 1} for chain armor (12 at all)
    • new int[]{2, 6, 5, 2} for iron armor (15 at all)
    • new int[]{2, 5, 3, 1} for gold armor (11 at all)
    • new int[]{3, 8, 6, 3} for diamond armor (20 at all - do not use more!)
  • The enchantability of the armor. This value determines the enchantments you get on average per level. The higher this value, the better the enchantments you get.
    Common values for the enchantability are:
    • 15 for leather armor
    • 12 for chain armor
    • 9 for iron armor
    • 25 for gold armor
    • 10 for diamond armor

For this tutorial I'll use the following values:

  • A durability of 16 (a bit better than iron)
  • A damage reduction array like this: new int[] {3, 8, 6, 3} (like diamond)
  • A enchantability of 30 (better than everything else)
public static ArmorMaterial TUTORIAL_ARMOR = EnumHelper.addArmorMaterial("TUTORIAL_ARMOR", 16, new int[] {3, 8, 6, 3}, 30);

The Item Class

We need to generate a new class for our armor items which extends ItemArmor. This class has a special constructor, so we need to override this one:

public class ItemModArmor extends ItemArmor {
    public ItemModArmor(ArmorMaterial p_i45325_1_, int p_i45325_2_, int p_i45325_3_) {
        super(p_i45325_1_, p_i45325_2_, p_i45325_3_);

Don't copy the constructor above because we will add some arguments to it:

public String textureName;

public ItemModArmor(String unlocalizedName, ArmorMaterial material, String textureName, int type) {
    super(material, 0, type);
    this.textureName = textureName;
    this.setTextureName(Main.MODID + ":" + unlocalizedName);

The first parameter of this constructor is the well-known unlocalizedName of the item which determines the item's texture. The second argument is our ArmorMaterial object. The next argument defines the name used for the skin overlay of the armor. I'll explain this in a minute. Last but not least, we need to define the armor type with the last parameter. 0 is a helmet, 1 a chestplate and so on.

These arguments are partially passed to the super constructor and partially used in methods; I think you know this procedure already.


The next thing to do is to tell Minecraft which texture overlay should be used when this armor is worn. Normally, this overlay is split into two images: One for helmet, chestplate and boots and one for the leggings. This allows overlays of the chestplate to enter the range of the leggins or overlays of the leggings to enter the range of the boots.

To tell Minecraft the used texture, we need to override the method getArmorTexture(). Note that this method is defined in Item.class, not in ItemArmor.class.

public String getArmorTexture(ItemStack stack, Entity entity, int slot, String type)
    return Main.MODID + ":textures/armor/" + this.textureName + "_" + (this.armorType == 2 ? "2" : "1") + ".png";

This method returns the name of the used texture. It's assets/armor/textureName_1.png for helmet, chestplate and boots and assets/armor/textureName_2.png for the leggings. I'll use textures from WeaponCraft again:

The last thing to do is, of course, the creation of the Items. This works like this:

public static Item tutorialHelmet;
public static Item tutorialChestplate;
public static Item tutorialLeggings;
public static Item tutorialBoots;


GameRegistry.registerItem(tutorialHelmet = new ItemModArmor("tutorial_helmet", ARMOR, "tutorial", 0), "tutorial_helmet"); //0 for helmet
GameRegistry.registerItem(tutorialChestplate = new ItemModArmor("tutorial_chestplate", ARMOR, "tutorial", 1), "tutorial_chestplate"); // 1 for chestplate
GameRegistry.registerItem(tutorialLeggings = new ItemModArmor("tutorial_leggings", ARMOR, "tutorial", 2), "tutorial_leggings"); // 2 for leggings
GameRegistry.registerItem(tutorialBoots = new ItemModArmor("tutorial_boots", ARMOR, "tutorial", 3), "tutorial_boots"); // 3 for boots

The textures of the items can be acquired here:

If we now run Minecraft, we can find our new armor in the "Combat" creative tab.

Armor Screenshot

Potion Effects

We still can add one improvement to our armor: A potion effect when it's worn.

As an example, I will make the leggings giving the player a speed boost.

To do this, we have to override the method onArmorTick:

public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (player.getCurrentArmor(1) != null && player.getCurrentArmor(1).getItem().equals(ModItems.tutorialLeggings))
    player.addPotionEffect(new PotionEffect(, 40));

This method tests every tick whether the player wears the tutorial leggings and if, it applies a speed effect for 40 Ticks (2 seconds). Note that in the method player.getCurrentArmor() the meaning of the parameter is different than above:

0 are the boots, 1 are the leggings and so on. Also note that you have to check if the slot is null, otherwise you might get an exception.

However, you can use the method parameter itemStack for the control as well. If you do this, it would look like that:

public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) {
if (itemStack.getItem().equals(ModItems.tutorialLeggings))
    player.addPotionEffect(new PotionEffect(, 40));

If you now run Minecraft and put the leggings in their slot, you'll get a swiftness effect.

You can download the code used in this tutorial as a .zip file from here.

Recommended tutorials to continue with

Comments and Questions:

If you want to report modding problems, please make sure to include the code in a pastebin link or something else! Don't just write "It doesn't work", otherwise your post will be deleted. For more complicated problems, please use the troubleshooter form.