Kzeroko KTM2

Equipment affix data

Native gem affix definitions, roll profiles and equipment consumable actions.

Updated Nov 1, 2026 4 min read

Equipment affixes are native gem data: one intrinsic affix on each eligible equipment stack, independent of its sockets. The bundled catalogue contains 324 definitions and 668 attribute/property effects.

Where the files live

Definitions live at data/<namespace>/gem_affixes/<path>.json; roll sources live at data/<namespace>/gem_affix_profiles/<path>.json. Each file’s path supplies its ID. Same-ID higher-priority resources replace the whole definition. The built-in sources are isekaiexpansion:imprint, isekaiexpansion:blacksmith and isekaiexpansion:merchant.

Minimal example

Save this as data/example/gem_affixes/resolute.json and provide the translation key in a resource pack.

{
  "name": "affix.example.resolute",
  "color": "light_purple",
  "rarity": "epic",
  "items": [
    "minecraft:iron_sword"
  ],
  "slots": [
    "mainhand"
  ],
  "attributes": [
    {
      "attribute": "minecraft:generic.attack_damage",
      "amount": 1.5,
      "operation": "ADDITION"
    }
  ]
}

Fields

FieldTypeDefaultMeaning
namestringrequiredTranslation key for the prefix.
colorstringrequiredMinecraft named text colour; formatting-only names reject.
rarityenumrequiredcommon, uncommon, rare, epic, legendary, unique; case-insensitive.
weightnumber1; finite ≥ 0Relative weight inside the selected rarity; 0 disables selection.
itemsarray<identifier>[]Registered items. At least items or tags must be nonempty.
tagsarray<identifier>[]Item tags without #; any target match qualifies.
slotsarray<enum>required; nonemptymainhand, offhand, head, chest, legs, feet. Armour additionally requires its actual slot.
attributesarray<object>[]Attribute modifier lines.
attributes[].attributeidentifierrequiredRegistered attribute.
attributes[].amountnumberrequired; finiteModifier amount. Negative values are supported.
attributes[].operationenumrequiredADDITION, MULTIPLY_BASE, MULTIPLY_TOTAL; case-sensitive.
propertiesobjectStack-level properties.
properties.durabilitynumber0; 0–10Maximum durability multiplier is 1 + value.
properties.mining_speednumber0; 0–10Mining speed multiplier is 1 + value.
fabric:load_conditionsarray<object>absentFabric resource conditions are checked before parsing.

Roll profiles

The imprint and merchant profiles use this distribution. Blacksmith uses epic 765, legendary 135 and unique 100, with lower rarities at 0.

{
  "rarities": {
    "common": 40,
    "uncommon": 30,
    "rare": 20,
    "epic": 10,
    "legendary": 5,
    "unique": 3
  },
  "levels_per_rank": 20,
  "suppression": 0.15,
  "quality_influence": 2.5
}
FieldTypeDefaultMeaning
raritiesobjectrequiredNonnegative finite rarity weights; at least one positive value. Omitted rarity has weight 0.
rarities.common / rarities.uncommon / rarities.rare / rarities.epic / rarities.legendary / rarities.uniquenumber0Relative rarity weight, not a probability.
affixesarray<identifier>[]Optional allowlist of existing affix IDs. Empty accepts all matching definitions.
levels_per_ranknumber20; finite > 0Equipment mastery scaling denominator.
suppressionnumber0.15; 0 < value ≤ 1Continuous suppression of rarities below the mastery floor.
quality_influencenumber0, range 0–8Strength of workmanship bias. The bundled blacksmith uses 5, imprint uses 2.5 and merchant uses 0.

For rarity index r (0–5) and mastery m, floor = min(5, max(0, m − 1) / levels_per_rank). Multiply the configured weight by suppression raised to max(0, floor − r). Then multiply by 2^((quality - 0.8) * quality_influence * r). Unmarked equipment uses quality 0.8. Higher workmanship favours rarer eligible tiers and lower workmanship favours more ordinary tiers. A zero base weight always stays zero. After choosing a tier, draw one matching definition by its own weight.

Gem consumable actions

isekaiexpansion:imprint_equipment_affix requires eligible equipment without an affix; isekaiexpansion:reroll_equipment_affix requires an existing valid affix. Their data.profile is an existing roll-profile ID, defaulting to isekaiexpansion:imprint. These actions target EQUIPMENT and do not consume a socket. The reroll action supports keep_choice; the reagent is spent whether the preview is kept or discarded. See gem data for the surrounding consumable fields.

Validation

Missing required fields, unknown item/attribute IDs, invalid enums, nonfinite values and invalid bounds reject the gem reload. Unknown optional fields are ignored. Empty target lists, empty slots and profiles without positive weights reject. Missing allowlisted affixes or consumable profile references reject. Tags resolve through current item tags, so an empty tag matches nothing. On failure the previous complete gem snapshot remains active.

Reloading

Affixes reload atomically with gem definitions and synchronise on join and successful reload. Equipment stores only the affix ID in ise_affix; removing its definition disables its effects. Rerolling preserves sockets, enchantments, mastery and unrelated NBT, and retains the damage fraction when maximum durability changes. There is no external affix dependency or old-data reader.

Gems and sockets explains consumables. Forgery explains craftsmanship, and gem runtime documents implementation contracts.