Terraria Wiki
Terraria Wiki
This template uses Lua.
This template uses Module:npcinfo, a script written in the Lua programming language. To learn more about Lua, see Terraria Wiki:Lua.
Template-info.svg Documentation The documentation below is transcluded from Template:GetNpcInfo/doc. (edit | history)

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

{{ 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

  • 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/all|Blue Slime}} results in:
Blue Slime (ID = 1) Info:
aiStyle: 1
boss:
buffImmune: 20
buffImmuneAll:
damage: 7
damage_e: 14
damage_e_hm: 62
damage_e_pp: 74
damage_m: 21
damage_m_hm: 93
damage_m_pp: 111
DeathSound: NPC_Killed_1
defense: 2
defense_e: 2
defense_e_hm: 10
defense_e_pp: 12
defense_m: 2
defense_m_hm: 10
defense_m_pp: 12
dontCountMe:
friendly:
HitSound: NPC_Hit_1
internalName=BlueSlime
knockBackResist: 1
knockBackResist_e: 0.9
knockBackResist_e_hm: 0.9
knockBackResist_e_pp: 0.9
knockBackResist_m: 0.8
knockBackResist_m_hm: 0.8
knockBackResist_m_pp: 0.8
lifeMax: 25
lifeMax_e: 50
lifeMax_e_hm: 274
lifeMax_e_pp: 330
lifeMax_m: 75
lifeMax_m_hm: 411
lifeMax_m_pp: 495
netID: 1
npcSlots: 1
playersCount:
rarity: 0
scale: 1
townNPC:
townCritter:
type: 1
value: 25
value_e: 62
value_e_hm: 250
value_e_pp: 300
value_m: 62
value_m_hm: 250
value_m_pp: 300