Skip to content

Quality / Tier and Display Layout

Belongs to: Server Owner Guide · Related: Affixes · Random Generation

This chapter covers two interrelated things: how quality (Tier) is defined, and how the final item's Lore is laid out.


Part 1: Quality / Tier

Configuration file: plugins/QinhItems/item_tiers.yml.

1. What is a Tier

A Tier is an item's rarity level (Common / Rare / Epic / Legendary…), and it controls:

  1. Display: shows a colored quality name at the top of the Lore.
  2. Glow: an optional item glow hint.
  3. Random generation parameters: the weight of being randomly selected (chance), and the capacity for how many affixes it can hold (capacity).

An item references a Tier via tier: EPIC (uppercase).

2. item_tiers.yml Structure

yaml
tiers:
  TRASH:
    name: '<gray>Trash</gray>'              # Display name (MiniMessage)
    generation:
      chance: 0.05                         # Weight of being selected during random generation

  COMMON:
    name: '<gray>Common</gray>'
    generation:
      chance: 0.30
      capacity:                            # Affix capacity parameters
        base: 2                            # Base slots
        scale: 0.25                        # Scale variable (× random[0,1))
        spread: 0.1                        # Extra variable
        max-spread: 0.25                   # High-end extra variable

  LEGENDARY:
    name: '<gold><bold>Legendary</bold></gold>'
    item-glow:                             # Glow hint
      hint: false
      color: GOLD                          # Bukkit DyeColor
    generation:
      chance: 0.08
      capacity:
        base: 10
        scale: 1.2
        spread: 0.12
        max-spread: 0.35

  EPIC:
    name: '<light_purple><bold>Epic</bold></light_purple>'
    unidentification:                      # Unidentified display
      name: 'Epic'
      prefix: '<light_purple>'
    generation:
      chance: 0.06
      capacity:
        base: 12
        scale: 1.5
        spread: 0.15
        max-spread: 0.4

3. Tier Field Table

KeyTypeMeaning
nameString (required)Colored display name (MiniMessage)
unidentification.nameStringPlain text name when unidentified (defaults to name with color stripped)
unidentification.prefixStringUnidentified prefix
item-glow.hintBooleanWhether to show the glow hint
item-glow.colorStringBukkit DyeColor name (e.g. GOLD)
generation.chanceDoubleWeight of this Tier being randomly selected (0–1, but really a relative weight)
generation.capacity.baseDoubleAffix capacity base value (guaranteed slots)
generation.capacity.scaleDoubleScale term (result += scale × random[0,1))
generation.capacity.spreadDoubleSpread term (added the same way)
generation.capacity.max-spreadDoubleHigh-end spread term (also written max_spread)

How is capacity computed into a slot count? See Random Generation → Capacity Calculation. Formula: base + scale×rand + spread×rand + maxSpread×rand, floored, and not less than 0.

4. Quality Resolution Order

When displaying an item, QI uses ItemTierRegistry.resolve() to decide which Tier to use, in this order:

  1. definition.tier (the tier: written in YAML)
  2. The variable values["tier"]
  3. The variable values["quality"] (matched by plainName or id, case-insensitive)

Tier lookup itself is case-insensitive (converted to lowercase internally), but uppercase is recommended in YAML for consistency.

🖼️ [Image placeholder] Color comparison of item names across different qualities (Trash/Common/Rare/Epic/Legendary) · suggested assets/tier-colors.png


Part 2: Lore Display Layout

QI uses StructuredLoreBuilder to automatically assemble an item's Lore in a fixed order. Once you understand this order, you'll know where each section comes from and how to adjust it.

5. Lore Section Order (top to bottom)

#SectionSourceFormat example
1Quality nameItemTierRegistry.resolve()<gold><bold>Legendary</bold></gold>
2Item typeType displayItem Type: Weapon
3Attribute linesproviders.ap resolutionAttack Damage: 22, Crit Rate: +12%
4DividerAutomatic──────────────── (inserted when there are attributes above and content below)
5Section LoreSection renderingLines produced by the affix pool
6Gem stategem-state▪ Embedded xxx
7Action LoreSkill description▸ Thunder Strike
8Empty gem socketsgem-sockets[ + ] Empty socket
9Set LoreSet renderingSet piece count / bonuses
10Description / Flavorlore: fieldThe description lines you write
11Requirementsoptions.restrictions✔ Requirement: Level 20 / ✘ Requirement: …
12Soul BindingInstance dataxxx's item, see Soul Binding
13DurabilityDepletable and not infinite durabilityDurability: 980 / 1000

Note: what you write in the lore: field lands in section 10 (Description / Flavor); quality, attributes, sets, etc. are automatically generated and inserted before it — you don't write them by hand.

6. Attribute Display Labels

The labels for attribute lines come from ApDisplayLabels. Built-in labels:

KeyLabelKeyLabel
attack_damageAttack DamagearmorArmor
attack_speedAttack Speedarmor_toughnessArmor Toughness
crit_rateCrit Ratemovement_speedMovement Speed
crit_damageCrit Damageknockback_resistanceKnockback Resistance
max_healthMax HealthlifestealLifesteal
damage_reductionDamage Reductionskill_damageSkill Damage
pvp_damagePVP Damagepve_damagePVE Damage

Keys not listed fall back to "underscores to spaces, first letter capitalized." If a value is a 0–1 ratio (such as crit_rate), it is displayed as a percentage +12%.

7. Name Prefixes/Suffixes and Star Levels

When the item name (display_name) is rendered:

  1. Variable substitution is done first ({variable}).
  2. Then the prefixes / suffixes produced by Sections / Affixes are applied.
  3. If the type supports star levels and values["star"] > 0, [+N] is appended to the end of the name.

Types that support the star-level suffix: weapon / armor / projectile / shield / gem.

8. Text Format: MiniMessage

All names / Lore support MiniMessage (<gold>, <gradient:#A:#B>, <bold>, etc.). Legacy & / § color codes are also supported (converted by DisplayText.normalizeToMini).

yaml
display_name: "<gradient:#9141AC:#C41E3A>Blade of the Epic</gradient>"
lore:
  - "<gray>Plain gray text</gray>"
  - "&eLegacy yellow (also supported)"

Next Steps