Skip to content

These docs were made completely by AI, so they might be right, or wrong, you'll need to test them yourself. This was made for a easier understanding of everything. So use at your own risk. If anything is wrong, please don't hurt to make a PR on the page you have a problem with. ON GITHUB

Armor

The armor system uses ArmorItem to handle wearable protection. There are five material tiers and four equipment slots.

Key source files: Minecraft.World/ArmorItem.h, Minecraft.World/ArmorItem.cpp

Each ArmorItem is built with an ArmorMaterial, a render index, and a slot index.

ArmorItem(int id, const ArmorMaterial *armorType, int renderIndex, int slot);
ParameterDescription
idItem ID offset (constructor adds 256)
armorTypePointer to an ArmorMaterial constant
renderIndexWhich armor model texture layer to use (0-4 for vanilla materials)
slotWhich body slot (0=head, 1=torso, 2=legs, 3=feet)

The constructor sets:

  • maxStackSize = 1
  • maxDamage = healthPerSlot[slot] * armorType->getDurabilityMultiplier()
FieldTypeDescription
slotintEquipment slot index
defenseintDefense points for this piece (from armorType->slotProtections[slot])
renderIndexintTexture layer index for rendering
armorTypeconst ArmorMaterial *The material this armor is made from

Defined in: ArmorItem::ArmorMaterial (nested class in ArmorItem.h), instantiated as _ArmorMaterial

ArmorMaterial(int durabilityMultiplier, const int slotProtections[4], int enchantmentValue);
ParameterDescription
durabilityMultiplierMultiplied by per-slot base health to get total durability
slotProtectionsArray of 4 defense values: {helmet, chestplate, leggings, boots}
enchantmentValueHow well this armor takes enchantments
const ArmorMaterial *CLOTH = new ArmorMaterial( 5, {1,3,2,1}, 15);
const ArmorMaterial *CHAIN = new ArmorMaterial(15, {2,5,4,1}, 12);
const ArmorMaterial *IRON = new ArmorMaterial(15, {2,6,5,2}, 9);
const ArmorMaterial *GOLD = new ArmorMaterial( 7, {2,5,3,1}, 25);
const ArmorMaterial *DIAMOND = new ArmorMaterial(33, {3,8,6,3}, 10);
MaterialDurability MultiplierDefense (H/C/L/B)Total DefenseEnchantability
Cloth (Leather)51 / 3 / 2 / 1715
Chain152 / 5 / 4 / 11212
Iron152 / 6 / 5 / 2159
Gold72 / 5 / 3 / 11125
Diamond333 / 8 / 6 / 32010

The getTierItemId() method uses pointer identity checks (comparing this against static constants) to return the repair item:

MaterialRepair Item
ClothLeather (Item::leather, ID 334)
ChainIron Ingot (Item::ironIngot, ID 265)
IronIron Ingot (Item::ironIngot, ID 265)
GoldGold Ingot (Item::goldIngot, ID 266)
DiamondDiamond (Item::diamond, ID 264)

If none match (custom material), returns -1.

ConstantValueSlot Name
SLOT_HEAD0Helmet
SLOT_TORSO1Chestplate
SLOT_LEGS2Leggings
SLOT_FEET3Boots

Durability is calculated as healthPerSlot[slot] * durabilityMultiplier.

static const int healthPerSlot[] = {11, 16, 15, 13};
SlotBase HealthPurpose
Helmet11Multiplied by material multiplier for final durability
Chestplate16Highest base, so chestplates are always the most durable
Leggings15Second highest
Boots13Third highest
PieceIDMaterialDefenseDurabilityEnchantability
Leather Helmet298Cloth155 (11*5)15
Leather Chestplate299Cloth380 (16*5)15
Leather Leggings300Cloth275 (15*5)15
Leather Boots301Cloth165 (13*5)15
Chain Helmet302Chain2165 (11*15)12
Chain Chestplate303Chain5240 (16*15)12
Chain Leggings304Chain4225 (15*15)12
Chain Boots305Chain1195 (13*15)12
Iron Helmet306Iron2165 (11*15)9
Iron Chestplate307Iron6240 (16*15)9
Iron Leggings308Iron5225 (15*15)9
Iron Boots309Iron2195 (13*15)9
Diamond Helmet310Diamond3363 (11*33)10
Diamond Chestplate311Diamond8528 (16*33)10
Diamond Leggings312Diamond6495 (15*33)10
Diamond Boots313Diamond3429 (13*33)10
Gold Helmet314Gold277 (11*7)25
Gold Chestplate315Gold5112 (16*7)25
Gold Leggings316Gold3105 (15*7)25
Gold Boots317Gold191 (13*7)25

In the Java source, chain armor is crafted using fire blocks (Tile::fire). But 4J Studios commented this out in the ArmorRecipes class:

// 4J-PB - removing the chain armour, since we show all possible recipes
// in the xbox game, and it's not one you can make
// ADD_OBJECT(map[0],Tile::fire);

Chain armor still exists in the game (IDs 302-305), but there is no crafting recipe for it. It can only be obtained through other means like mob drops or commands.

Leather armor (ArmorMaterial::CLOTH) supports custom colors through NBT. The color data lives at tag.display.color as an integer.

When no custom color is set, getColor() returns DEFAULT_LEATHER_COLOR, which maps to eMinecraftColour_Armour_Default_Leather_Colour.

Leather armor has two sprite layers (checked via hasMultipleSpriteLayers()):

  1. Base layer (getIcon(0)) gets tinted with the custom color
  2. Overlay layer (getIcon(1)) renders untinted, providing detail that stays the same regardless of dye

This dual-layer system is why leather armor always has those little accent details that stay the same color even when you dye it.

getEmptyIcon() returns the grayscale armor slot icon shown in the player’s armor equipment slots when no armor is equipped.

Dyeing happens through the ArmorDyeRecipe crafting recipe, which combines leather armor with one or more DyePowderItem instances. See Crafting & Recipes for the details on that system.

MethodDescription
getMaterial()Returns the ArmorMaterial pointer
getDefense()Returns defense value for this piece
getColor(ItemInstance *)Returns custom color from NBT, or default
hasMultipleSpriteLayers()Returns true only for CLOTH material
getIcon(int layer)Layer 0 = base, layer 1 = overlay (CLOTH only)
getEmptyIcon()Grayscale slot icon for empty armor slots
isValidRepairItem(source, repair)Checks if repair item matches material’s getTierItemId()
getEnchantmentValue()Returns the material’s enchantment value

The armor system is mostly unchanged. Same five materials, same defense values, same durability multipliers.

The main difference is naming: the CLOTH material’s item fields are renamed from _cloth to _leather (e.g., boots_cloth becomes boots_leather, helmet_cloth becomes helmet_leather, etc.). This is just a naming cleanup to match vanilla Minecraft’s conventions. The ArmorMaterial enum value itself is still CLOTH internally.

MinecraftConsoles also adds horse armor items (horseArmorMetal, horseArmorGold, horseArmorDiamond), but those are not wearable by players. They are equipment for the new horse entity. Horse armor protection values are defined in EntityHorse as ARMOR_PROTECTION[4] for none/iron/gold/diamond.