Equipment affix data
Native gem affix definitions, roll profiles and equipment consumable actions.
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
| Field | Type | Default | Meaning |
|---|---|---|---|
name | string | required | Translation key for the prefix. |
color | string | required | Minecraft named text colour; formatting-only names reject. |
rarity | enum | required | common, uncommon, rare, epic, legendary, unique; case-insensitive. |
weight | number | 1; finite ≥ 0 | Relative weight inside the selected rarity; 0 disables selection. |
items | array<identifier> | [] | Registered items. At least items or tags must be nonempty. |
tags | array<identifier> | [] | Item tags without #; any target match qualifies. |
slots | array<enum> | required; nonempty | mainhand, offhand, head, chest, legs, feet. Armour additionally requires its actual slot. |
attributes | array<object> | [] | Attribute modifier lines. |
attributes[].attribute | identifier | required | Registered attribute. |
attributes[].amount | number | required; finite | Modifier amount. Negative values are supported. |
attributes[].operation | enum | required | ADDITION, MULTIPLY_BASE, MULTIPLY_TOTAL; case-sensitive. |
properties | object | Stack-level properties. | |
properties.durability | number | 0; 0–10 | Maximum durability multiplier is 1 + value. |
properties.mining_speed | number | 0; 0–10 | Mining speed multiplier is 1 + value. |
fabric:load_conditions | array<object> | absent | Fabric 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
}
| Field | Type | Default | Meaning |
|---|---|---|---|
rarities | object | required | Nonnegative finite rarity weights; at least one positive value. Omitted rarity has weight 0. |
rarities.common / rarities.uncommon / rarities.rare / rarities.epic / rarities.legendary / rarities.unique | number | 0 | Relative rarity weight, not a probability. |
affixes | array<identifier> | [] | Optional allowlist of existing affix IDs. Empty accepts all matching definitions. |
levels_per_rank | number | 20; finite > 0 | Equipment mastery scaling denominator. |
suppression | number | 0.15; 0 < value ≤ 1 | Continuous suppression of rarities below the mastery floor. |
quality_influence | number | 0, range 0–8 | Strength 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.
Related
Gems and sockets explains consumables. Forgery explains craftsmanship, and gem runtime documents implementation contracts.