getGearScore

public static double getGearScore(Player player, ArmorDefenseCalculator.DamageType type)

Computes the player's total gear score for the gear reduction formula.

The gear score combines two components with different slot sources:

gearScore = (sum of armorLevel for 4 armor slots) / 4
          + (sum of enchantBonus for ALL 6 slots) / 4

Why armor level uses only 4 slots: Only actual armor pieces (helmet, chestplate, leggings, boots) have meaningful armor levels. Weapons and shields don't provide armor defense.

Why enchant bonus uses 6 slots: Protection enchantments can appear on weapons and shields (especially elite items). Including mainhand + offhand rewards tank builds that enchant shields with Protection, providing up to 50% more enchant contribution than armor-only builds (6/4 = 1.5×).

Why both are divided by 4: The /4 normalizes the gear score to a single "average armor level" unit, so it can be directly compared to mob level. Without normalization, a level-25 player with four level-25 armor pieces would have a gear score of 100 instead of 25.

Example — Lv25 full matched gear, Prot IV all, melee:

armorLevelSum = 25 + 25 + 25 + 25 = 100 → /4 = 25.0
enchantBonus per armor piece = 4 * (1/3) = 1.333  (Protection IV, melee → no type-specific)
enchantBonusSum = 1.333 * 4 + 0 + 0 = 5.333 → /4 = 1.333
gearScore = 25.0 + 1.333 = 26.333

Edge case — partial armor: If a player wears only 2 armor pieces, armorLevelSum is halved but still divided by 4, yielding half the gear score. This is intentional — missing armor slots are a real defensive gap.

Return

The gear score in armor-level-equivalent units

Parameters

player

The player whose equipment to evaluate

type

The damage type being defended against