Repository navigation
Rules
Rule files decide what Statscope does with an item: whether it is equipment and which template it gets, which values are core stats, and which section every line of another mod goes to. How it looks is the job of the style.
| Location | Use |
|---|---|
assets/<namespace>/statscope/rules/*.json |
in a resource pack or a mod; the built-in files are in assets/statscope/statscope/rules/
|
config/statscope/rules/*.json |
for a modpack or yourself; lies on top of the resources |
All files are read in the order of their names (resources first, then config/statscope/rules/) and merged: maps by key, line rules by id. A later file only needs the entries it changes; "disabled": true switches a built-in line rule off. Every file has "format": 1. Broken entries are logged with file and path and skipped. /statscope reload or F3+T reloads them.
| Built-in file | Content |
|---|---|
00_base.json |
categories (item → template), core_stats per template, line rules for NeoForge's attribute lines and vanilla |
10_apotheosis.json |
affix_sections (affix types → sections), Apotheosis' lines |
20_spell_engine.json |
spells and set bonuses of Spell Engine |
30_mods.json |
lines of other mods: RarityCore, Dungeon Difficulty, Modern Enchantments Limiter, Enchantment Descriptions, Better Combat, Afterwear, Durability Tooltip, Quark, Curios, Accessories, Iceberg, Silent Gear, Create Stuff & Additions, Immersive Armors, Remnant Bosses, BetterEnd, Loot n Explore, Relics |
40_enchantments.json |
how enchantment effects and conditions are read (enchantment_effects, enchantment_conditions, enchantments) |
50_compare.json |
partners and polarity of the Comparison |
Templates: melee, ranged, caster_weapon, armor, caster_armor, shield, jewelry, tool. The order of the checks:
- Tag
statscope:exclude→ not equipment, the tooltip stays as it is. - Statscope's own tags
statscope:template/<template>(listed incategories.tags). - Apotheosis' loot category (
categories.apotheosis, e.g."apotheosis:breaker": "tool"). - The other tags of
categories.tags, e.g.c:tools/bow→ranged,c:armors→armor,curios:ring→jewelry. - The item class (sword, armor, bow, shield, tiered item …).
- Tag
statscope:include→ a leantoolfor anything else.
An item whose own values give a spell school becomes caster_weapon or caster_armor (affixes and gems do not count). The spell schools come from Spell Power's registry: every school of the magic archetype except generic, so add-ons such as More RPG Library count too, while their ranged and melee schools (Fire Ranged, Rage Melee …) do not. categories.caster.school_attributes adds schools of mods without Spell Power, categories.caster.exclude_school_attributes takes a school out:
{
"format": 1,
"categories": {
"caster": { "school_attributes": ["mymod:ice_power"], "exclude_school_attributes": ["spell_power:soul"] }
}
}{
"format": 1,
"categories": {
"tags": [ { "tag": "c:tools/spear", "template": "melee" } ]
}
}core_stats lists the core stat slots per template. Each slot names candidate attributes; only attributes the item really has are shown. pick is first (the first candidate the item has, default) or max (the largest one; it only compares candidates of the same kind as the first one the item has, spell schools with spell schools and other attributes with other attributes, so max mana is never compared with spell power). { "schools": true } is one slot per spell school the item has, the highest value first (the built-in caster_weapon).
Only attributes from the item itself and from the power level count as core stats and base values. An attribute that only affixes or gems give stands in the affix group and never takes a core stat slot.
Built in: armor and caster_armor show armor, toughness, max health and max mana (runelessrpg:max_mana, irons_spellbooks:max_mana, ars_nouveau:ars_nouveau.perk.max_mana); the first value the item has is the big one.
{
"format": 1,
"core_stats": {
"ranged": [
{ "attributes": ["ranged_weapon:damage", "apothic_attributes:arrow_damage"] },
{ "attributes": ["ranged_weapon:pull_time", "apothic_attributes:draw_speed"] }
],
"jewelry": []
}
}An empty list means no big core stat (jewelry, tools and shields by default). A pack that wants a core stat for rings again writes e.g. "jewelry": [ { "first_attribute": true } ] (the first attribute of the item definition).
Every line of the tooltip that is not built by Statscope itself is matched against the line rules (line_rules). The rule with the highest priority wins; on equal priority a match on the outer translation key beats a match deeper inside the line. A line that no rule matches goes to other, in its original order.
{
"format": 1,
"line_rules": [
{ "id": "mymod_soulbound", "source": "mymod",
"match": { "key": "tooltip.mymod.soulbound", "scope": "outer" },
"section": "type", "join": true },
{ "id": "mymod_lore", "source": "mymod",
"match": { "key_prefix": "tooltip.mymod.lore.", "scope": "tree" },
"section": "other", "visibility": "ctrl", "block": {} }
]
}| Field | Values (default) | Meaning |
|---|---|---|
id |
text | name of the rule; same id in a later file replaces it |
source |
mod id | only for the dump and the debug key |
match |
object | what the line must look like (below) |
section |
section id | where the line goes (type, core, base, affixes, resistances, effects, legendary, sockets, enchantments, set_bonus, spells, other, malice, footer, advanced) |
section_by_template |
{ "<template>": "<section>" } |
a different section per template, e.g. { "melee": "core" }
|
visibility |
always / alt / ctrl / no_alt / no_ctrl / off (always) |
when the line shows; the Alt or Ctrl version of a line replaces the normal one |
priority |
number (0) |
higher wins |
order |
number (0) |
sort key inside the section (lines with equal order keep their order) |
replaced_by |
data source id | the line is dropped while Statscope shows the same data itself (e.g. curios:attributes, statscope:durability, bettercombat:range, raritycore:rarity, spell_engine:spells, apotheosis:affixes) |
join |
bool (false) |
joined into the first line of the section (the type line) |
drop |
bool (false) |
always removed |
block |
object | also take the following lines without a key (plain text of the same mod) until the next empty or recognized line; section, visibility and keyed_visibility (for taken lines that still have a key) |
disabled |
bool (false) |
switches off a rule with this id from an earlier file |
Field of match
|
Meaning |
|---|---|
key |
exact translation key |
key_prefix |
key starts with … |
key_pattern |
key matches a regular expression |
scope |
outer (only the key of the line itself), tree (any key inside the line), any (default, both) |
outer_key_pattern |
additional condition on the outer key |
component_class |
class name of a tooltip component (e.g. Iceberg's title component) |
style |
color, font, bold, italic of any part of the line |
literal_pattern |
regular expression on the text of a line without a key (use sparingly: translated text differs per language) |
Statscope always matches translation keys, never the translated text, so a rule works in every language. /statscope dump shows the keys of every line.
- Hold the item in your main hand and run
/statscope dump. Statscope writesconfig/statscope/dumps/<item id>_<date>_<time>.jsonand.txtand puts a link into the chat. The.txtlists every line with its translation keys, color, the matching rule with its source and where Statscope put it. - Hold the debug key on the item (bind Tooltip: debug first): every section lists its lines with the rule (and file) that placed them; lines in
otherhave no rule yet. - Write a rule into
config/statscope/rules/90_mypack.json(any name; later names win) with the key from the dump. -
/statscope reload, hover the item again, check with the debug key.

The debug key shows below each section "▸
" and for every line an excerpt, the rule and its file, the ident (for the comparison) and the source mod; at the end the dropped lines with their reason (replaced by which data source, or dropped). It is on by default (debugKey in the Configuration) and not bound.
affix_sections sorts Apotheosis' affixes: first by the codec type of the affix (codec_types, e.g. "apotheosis:damage_reduction": "resistances"), then by its affix type (affix_types: stat → affixes, basic_effect → effects, ability → legendary). Affixes of add-on mods with their own codec type can be placed the same way.
compare.partners per template: slots (mainhand, offhand, same_slot, curios) and match (category, tool_kind, slot). compare.polarity per attribute: higher, lower or neutral (default: the color the game gives a positive value).
{ "format": 1, "compare": { "polarity": { "mymod:cooldown": "lower" } } }| Command | Does |
|---|---|
/statscope reload |
reloads rule and style files and says how many were loaded |
/statscope dump |
writes the raw lines of the item in the main hand to config/statscope/dumps/
|
Both are client commands; they work on any server.
Statscope for NeoForge 1.21.1 · CurseForge · Source · Report a bug
Start
Using Statscope
Customizing
Reference