Owl.png Wiki reading hard on the eyes? Try out our Dark Theme! Visit the preferences page while logged in and select Hydra Dark. Owl.png

Template:GetNpcInfo/doc

From Terraria Wiki
Jump to: navigation, search

This template is used to dynamically and reliably display an NPC's stats. It is based on Module:Npcinfo, which takes its data directly from the source code. This facilitates displaying stats without having to change them in case of updates. {{npcinfo}} can be used as a shortcut for this template.

An example usage can be found on the Bosses page, where the health of almost every boss is presented using this template.

Usage[edit source]

{{ npcinfo | <name or ID of the NPC> | <specific stat> | mode(expert/master/e-hm etc.) | format=y/yes (optional) }}

First unnamed parameter

ID of the NPC or name of the NPC, as used in the database: Template:NpcIdFromName.

Second unnamed parameter

Specific stat to be displayed; see the tables below for valid values. You can use {{npcinfo/all}} to display all stats.

Third unnamed parameter

Specific game mode; can be expert/e/e_hm/e_pp/expert_prehardmode/expert_hardmode/expert_postplantera/expert_post_planteraexpert_after_plantera/m/master/m_hm...

Original raw variable name
(case-insensitive)
Alias Note
aiStyle ai ID of the AI the NPC uses.
boss Prints 1 if NPC is a boss.
buffImmuneAll Prints 1 if NPC is immune to all buffs.
buffImmune immunities
immune
A comma-separated, linked list of buffs the NPC is immune to.
critter Prints 1 if NPC is a critter (by wiki definition).
damage Damage the NPC deals in normal mode / ExpertDesktop, Console, and Mobile Versions pre-Hardmode / Expert Hardmode / Expert post-Plantera.
damage_expert
damage_hardmode
damage_postplantera
DeathSound Sound effect that is played when this NPC takes damage (or reflects a projectile), wrapped in {{sound}} without a caption. Note that the listed sound is only the base sound; it might be played with modified pitch and volume in-game.
defense Defense of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
defense_expert
defense_hardmode
defense_postplantera
friendly Prints 1 if NPC is a friendly NPC.
HitSound Sound effect that is played when this NPC dies, wrapped in {{sound}} without a caption. Note that the listed sound is only the base sound; it might be played with modified pitch and volume in-game.
internalName internal name Internal name of the NPC.
knockBackResist knockback
kb
Knockback resistance of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
knockBackResist_expert knockback_expert
kb_expert
knockBackResist_hardmode knockback_hardmode
kb_hardmode
knockBackResist_postplantera knockback_postplantera
kb_postplantera
lifeMax maxlife
health
hp
Max Health of the NPC in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
lifeMax_expert maxlife_expert
health_expert
hp_expert
lifeMax_hardmode maxlife_hardmode
health_hardmode
hp_hardmode
lifeMax_postplantera maxlife_postplantera
health_postplantera
hp_postplantera
netID id ID of the NPC.
townNPC Prints 1 if NPC is a Town NPC.
townCritter Prints 1 if NPC is a town critter (by source code definition).
type Corresponding "base" or "master" variant of this NPC if netID is negative. Equal to netID if netID is positive.
projectileNPC Prints 1 if NPC is a projectile.
value coins
coindrop
Amount of coins the NPC drops in normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera.
value_expert coins_expert
coindrop_expert
value_hardmode coins_hardmode
coindrop_hardmode
value_postplantera coins_postplantera
coindrop_postplantera
Combined values (only if not using raw=y)
damage_all Displays the combined values of normal mode / Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera. Value (coins dropped) is in Copper Coins.
defense_all
knockBackResist_all knockback_all
kb_all
lifeMax_all maxlife_all
health_all
hp_all
value_all coin_all
coindrop_all
damage_expert_all Displays the combined values of Expert pre-Hardmode / Expert Hardmode / Expert post-Plantera. Value (coins dropped) is in Copper Coins.
defense_expert_all
knockBackResist_expert_all knockback_all
kb_all
lifeMax_expert_all maxlife_all
health_all
hp_all
value_expert_all coin_all
coindrop_all
format = y/yes

Use this parameter to wrap the variable in the magic word {{formatnum:}} (documentation). Only available when using a second unnamed parameter.

raw = y/yes

Use this parameter to output the value exactly as it exists in the source code. See Module:Npcinfo for information about how to interpret the output values. Only available when using a second unnamed parameter. Requires the second unnamed parameter to constitute an original variable name, i.e. no aliases are allowed. format is still applicable. Renders the second unnamed parameter case-sensitive.

Examples[edit source]

  • The Eye of Cthulhu has {{npcinfo|Eye of Cthulhu|hp|format=y}} / {{expert|{{npcinfo|Eye of Cthulhu|hp_expert}}}} health and deals {{npcinfo|Eye of Cthulhu|damage}} damage. It is immune to the {{npcinfo|Eye of Cthulhu|immunities}} debuff.
results in:
The Eye of Cthulhu has 2,800 / 3640 health and deals 15 damage. It is immune to the Confused debuff.
  • {{npcinfo|Blue Slime|damage}} results in: 7
  • {{npcinfo|1|damage}} results in: 7
  • {{npcinfo|Blue Slime|hp_all}} results in: 25 / 50274330 / 75411495
  • {{npcinfo|Blue Slime|hp_expert_all}} results in: 50274330 / 75411495
  • {{npcinfo|Blue Slime|knockback_all}} results in: 0% / 10% / 20%
  • {{npcinfo|Blue Slime}} results in:

InvalidNpcinfoStatName