Skip to content

Affix System (affixes.yml)

In: Server Owner Guide Overview · Upstream: Realm & Keystone · Related: Loot System · Affix Scripts (JS)

An Affix is a realm's enhancement modifier: a number of them are randomly injected by tier on activation, rewriting this realm's spawns / environment / rules / loot. This page breaks down every field of affixes.yml, the 11 effect.types, the danger-budget constraint, and lists the 13 built-in affixes.

🔑 Architectural red line: QR does not compute stats / attributes. The way an affix makes "mobs stronger" = attaching a level to the mob when it spawns, and MythicMobs scales the stats itself; player attributes are delegated to the attribute plugin; QR only orchestrates quantity / environment / rules / loot.


1. What an Affix Looks Like

File: plugins/QinhRuins/affixes.yml; under the top-level affixes:, each key is an affix id.

yaml
affixes:

  elite-swarm:                  # affix id (rolled by tier on activation)
    name: "&cElite Swarm"        # display name (& color codes; goes into Bossbar / keystone Lore / activation broadcast)
    lore: ["&7Spawn count +50%"] # description lines (the player-visible affix description)
    category: MOB               # category: MOB | PLAYER | ENV | LOOT (a semantic tag only, for grouping)
    group: mob-count            # exclusion group: only one affix in the same group appears at a time (omit = no exclusion)
    danger: 30                  # danger value (consumes the difficulty budget)
    reward: 30                  # reward value (together with danger, decides the weighted draw chance)
    min-tier: 2                 # minimum tier threshold (won't be rolled below this tier)
    # max-tier: 999             # maximum tier threshold (optional, default 999)
    effect:
      type: mob-count-mult      # effect type (see §2, 11 in total)
      params: { mult: 1.5 }     # parameters for that type

Field Quick Reference

FieldMeaningDefault
nameDisplay name (& color codes); falls back to idid
lorePlayer-visible description lines (list)empty
categoryMOB/PLAYER/ENV/LOOT, a semantic tagMOB
groupSame-group exclusion group name; omit = doesn't participate in exclusionnone
dangerDanger value, constrained by the tier's danger-budget10
rewardReward value; danger+reward decides the weighted weight10
min-tier / max-tierThe tier range in which it appears1 / 999
effect.typeEffect type (one of 11)empty (no effect)

Draw weight = danger + reward: an affix that's both dangerous and fat is more likely to be drawn. A pure-fat affix with danger:0 (Greed / Golden Touch / Hidden Trove) doesn't eat the budget and props up its weight via reward.


2. All 11 effect.type

The comments at the top of affixes.yml are the authoritative reference. One by one:

typeEffectParams / fields
mob-level-bonusSpawn level +bonus (MM scales the stats itself; QR doesn't change values)params: { bonus: <integer> }
mob-count-multSpawn count ×mult (QR orchestrates quantity, not stats)params: { mult: <multiplier> }
player-statusAttaches vanilla potion effects to players in range (continuously refreshed)params: { effect_name: level }, multiple allowed
no-healNo-heal rule: cancels all healing in rangeparams: {}
time-limitTime limit (seconds); the shortest is taken among multipleparams: { seconds: <seconds> }
loot-quantity-multCleanse drop quantity ×mult (multiplied with loot-bonus)params: { mult: <multiplier> }
unique-chance-multWeight of unique:true entries in the loot table ×multparams: { mult: <multiplier> }
currency-multCleanse currency reward ×mult (via the CoreLib economy bridge)params: { mult: <multiplier> }
broadcastServer-wide broadcast on activationmessage: "..." (supports {ruin}/{tier})
commandRuns commands on present players on activationcommands: [ ... ] (supports {player}/{tier})
scriptJS script custom logicscript: "qinhruins:file.js:function"

Key points:

  • player-status params keys are vanilla potion effect names (e.g. SLOWNESS/WEAKNESS/DARKNESS/MINING_FATIGUE), and the values are levels (0 = level I); multiple may be written. The effect refreshes every second, and the player keeps suffering it while within the realm range.
  • Affixes of the same type stack: multiple mob-count-mult multipliers chain-multiply, multiple mob-level-bonus sum, and multiple time-limit take the shortest.
  • A command affix is written directly in yaml and run with console identity; a script affix funnels to the developer scripts page: the logic lives in scripts/*.js, called by QR via CoreLib's GraalJS. See Affix Scripts (JS) for details.

command / script Affix Examples

yaml
  # command affix ({player}=player name {tier}=tier)
  blood-ritual:
    name: "&4Blood Ritual"
    danger: 25
    reward: 20
    min-tier: 3
    effect:
      type: command
      commands:
        - "effect give {player} minecraft:wither 200 0"
        - "mm mobs spawn EliteBoss 1 {player}"

  # JS script affix (logic in scripts/affix_example.js)
  scripted-trial:
    name: "&cTrial of Blood"
    danger: 25
    reward: 20
    min-tier: 3
    effect:
      type: script
      script: "qinhruins:affix_example.js:onActivate"

3. Danger Budget

On activation QR rolls affix-count affixes by tier (see Realm & Keystone §3), subject to two constraints:

  1. Danger budget (danger-budget): the sum of all chosen affixes' danger must not exceed that tier's budget (tiers.danger-budget, default 40 + tier*10). This prevents low-tier hell stacking — with a T1 budget of 50, you can't assemble a heavy combo like "No Heal (45) + Time Limit (30) + Horde (45)"; you have to climb to a high tier where the budget is enough.
    • The first affix is always guaranteed: the first affix is force-selected ignoring the budget, ensuring every realm has at least one affix.
    • Writing danger-budget as ≤0 (or "0") = no budget limit.
  2. Same-group exclusion (group): once one affix is chosen, all other affixes in its same group are removed from the pool. For example, if "Elite Swarm" is chosen, "Horde" won't appear again (both belong to the mob-count group).

The draw is weighted random: candidate affixes are drawn weighted by danger+reward, then validated against the budget and exclusion. Affixes that don't satisfy min-tier/max-tier never enter the candidate pool.


4. Exclusion Groups at a Glance

The two exclusion groups of the built-in affixes:

groupMutually exclusive membersMeaning
mob-countElite Swarm / HordeSpawn-count type, only one at a time
mob-levelVeteran / OverlordMob-level type, only one at a time

🖼️ [Image placeholder] Multiple affix names shown side by side at the top of the realm Bossbar (e.g. "Overlord Sands-of-Time Golden-Touch"), so the player reads this tier's modifiers at a glance · suggested assets/affix-bossbar.png

For a new exclusion relationship, just give the affixes the same group string (any name works; same name means mutually exclusive).


5. The 13 Built-in Affixes

idNameCategorygroupdanger / rewardmin-tierEffect
elite-swarmElite SwarmMOBmob-count30 / 302Spawn count ×1.5
hordeHordeMOBmob-count45 / 455Spawn count ×2.0
veteranVeteranMOBmob-level25 / 201Mob level +2
overlordOverlordMOBmob-level40 / 354Mob level +5
oppressionOppressionPLAYER20 / 151Slowness I + Mining Fatigue I
enfeebleCurse of EnfeeblementPLAYER25 / 202Weakness I
eternal-nightEternal NightENV20 / 181Darkness (DARKNESS)
brittle-wardBrittle WardPLAYER45 / 405Disables all healing (no-heal)
sands-of-timeSands of TimeENV30 / 303Time limit 5 minutes (300s)
greedGreedLOOT0 / 501Loot quantity ×2.5
golden-touchGolden TouchLOOT0 / 451Currency drops ×3.0
hidden-troveHidden TroveLOOT0 / 603Exclusive item drop rate ×3.0
heraldRealm DescentENV0 / 51Server-wide broadcast on activation

affixes.yml also ships two commented-out examples, blood-ritual (command) and scripted-trial (script); just remove the # to enable them.


6. Don't Forget After Editing

  • After editing affixes.yml, run /qr reload to apply.
  • LOOT-type affixes (Greed / Golden Touch / Hidden Trove) depend on the cleanse loot table and economy plugin configuration; for the setup see Loot System and Realm & Keystone §5.
  • How affixes are rolled and how the danger budget loosens with tier → see Realm & Keystone.

Next Steps