Terraria Wiki

Miss the old Hydra Skin? Try out our Hydralize gadget! Visit the preferences page while logged in and turn on the gadget.

READ MORE

Terraria Wiki
Advertisement
Terraria Wiki
This template is i18n-ready, which means it is easy to localize for different languages. Please see i18n & l10n for templates to learn more.
See Template:Npc infobox/l10n for the localization of this template.
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:Npc infobox/doc. (edit | history)

This template is used for displaying the infobox for an NPC (including enemies, bosses, critters, etc.). Together with {{item infobox}}, it is one of the most important and most powerful infobox templates.

Usage

The template's main functionality is to display the standard infobox.

The data which is to be displayed can be manually entered when calling the template, but thanks to {{npcinfo}}, the vast majority of data is generated automatically. To enable automatic data, use the parameter auto and set it to the ID of the NPC (alternatively: auto=yes and either id=<NPC ID>, name=<NPC name>, or nothing else – the latter two methods will cause the template to automatically generate the ID using {{npcNameFromId}}, with the last method using the page title for name reference). This way, all relevant NPC parameters are set automatically. See the table below for affected parameters. However, they can still be overridden, and manually entered parameters always take precedence over the automatic ones.

Basic parameters

Notes:
  • The dollar sign ($) is used to signify that the word after it is the name of a template parameter.
  • All parameters which have a default value listed can usually be omitted. Note that this does not mean that parameters which do not have a default value listed should always be filled in.
Parameter Description Auto Example Default value
(if omitted)
Note
{{npc infobox

Box-related parameters

Box-related parameters
| boxwidth Width of the infobox 27em Number with unit. The box is adjusting to the width of the images by default.
| float Position of the infobox left right
| css
 or
| style
CSS style affecting the entire infobox Any width or float properties defined here will override the template's $boxwidth and $float parameters, respectively.
| tab
 or
| tabs
Toggle difficulty tabs n The Classic/Expert/Master tabs will not be used for town NPCs, critters, furniture, and exclusive variants, and will be used for all other NPCs. This parameter overrides this default configuration.
| auto Enables automatic data 201 Can also be yes (see notes above).
| id ID of the NPC ✔️ 201 Cosmetic ID to be displayed, overrides the display of $auto and $idcargo.
| name Name of the NPC ✔️ Skeleton <page name> Will be displayed as the heading of the infobox.
| name2 Cosmetic addition to the name &#32; / {{expert|Lunatic Cultist}} Will be directly appended to $name.
| namesub Name sub-heading ✔️ Additional information directly underneath the title of the infobox. Mainly internal NPC variant names, like Astronaut Skeleton.
| namesub2 Name sub-heading First Form Additional information directly underneath the title of the infobox or underneath $namesub. Intended to be used as a manual $namesub, because manually setting $namesub to something would prevent its automatic display.
| namenote Name sub-sub-heading ✔️ Will be displayed underneath $namesub / $namesub2. Mainly NPC variant descriptions, like Halloween Variant 2.
| variant Platform-exclusivity note yes Displays a note at the top of the infobox informing about the Old-gen console version Old-gen console and 3DS3DS version-exclusivity of the NPC.
| expertonly Expert-exclusivity of the NPC yes Removes the "Classic" tab and displays the following line underneath title / $namesub / $namesub2 / $namenote: (Expert Mode exclusive)
| masteronly Master-exclusivity of the NPC yes Removes the "Classic" and "Expert" tabs and displays the following line underneath title / $namesub / $namesub2 / $namenote: (Master Mode exclusive)

Image-related parameters

Image-related parameters
| imagealt Complete custom control over the display of the first image [[File:Skeleton.png]] Overrides the $image and $imagesize parameters. Multiple images can be provided and/or text and other formatting.
| image Main image of the NPC Skeleton.png $namesub.png or $name.png This is the image that is stored to cargo by default.
| imagesize Size of the main image 40x20px*0.75 *1 Corresponds to the size parameter of {{image}}: <width>x<height>*<scale>
| imageexpert Image of the Expert variant Skeleton.png
| image2 Additional image Skeleton.png Default value: <$image without ".png">_(old).png / .gif. Leave it empty to disable this automatic old image discovering.
| imagemode Controls image display full Setting it to anything other than full prevents the automatic display of $image2.
| image3 Additional image Skeleton.png
| imageversion2 Exclusive versions of $image2 desktop-console old-gen-3ds Versions that will be displayed when hovering over $image2 (by default the _(old) one, so the "old" versions are the default). Valid values are desktop, console, mobile, old-gen, and 3ds.
| imageversion3 Exclusive versions of $image3 desktop-console Versions that will be displayed when hovering over $image3. Valid values are the same as for $imageversion2.
| imageother Additional, visually separated image Map Icon Skeletron.png Will be displayed underneath all other images, above the statistics, separated by a horizontal line at the bottom of the infobox. Usually used for map icons or sprites of NPCs' temporary states (e.g. the "rolling" state of the Sroller). Can be a slash-separated (/) list for multiple images.
| imageothercaption Caption of $imageother Rolling state Will be displayed underneath $imageother. Has no effect if $imageother is not set. Is not mandatory; the image will also be displayed if the caption is omitted.

Statistics-related parameters

Statistics-related parameters
| type
 (deprecated:
| type2,
| type3)
Classification and categorization Boss Enemy Broad classifications like "Flying Enemy", "Critter", etc. Separate multiple values with a slash (/). All types will be linked, if the respective page exists.
| environment
 (deprecated:
| environment2,
| environment3)
Native environment of the NPC Desert
Forest+Rain
Desert / Forest
Desert / Forest+Rain
Biome in which or event during which the NPC naturally spawns. All environments will be linked if the respective page exists. A plus (+) means "AND" and a slash (/) means "OR".

The $environment2 and $environment3 parameters are connected to $environment via an "OR" (i.e. |environment=A|environment2=B|environment3=C is the same as |environment=A/B/C), but please note that these two parameters are deprecated. Only $environment should be used.

| ai AI style of the NPC ✔️ Fighter AI
| damage Damage ✔️
| damage2 Addition to the damage Will be directly appended to $damage. Can be used, for instance, for differentiation between different attacks of the NPC or different platforms.
| life Maximum health of the NPC ✔️
| life2 Addition to the maximum health Will be directly appended to $life.
| defense Defense of the NPC ✔️
| defense2 Addition to the defense Will be directly appended to $defense.
| knockback Resistance to knockback of the NPC ✔️
| knockback2 Addition to the knockback resistance Will be directly appended to $knockback.
| banner Banner of the NPC ✔️ yes Setting it to yes will cause it to take $name Banner as the banner name, but it can also simply be set to the name of the banner.

Note that, if using $auto and the NPC having a valid banner associated to it, the banner item will be stored to cargo in a hidden {{item infobox}}.

| immune
 (deprecated:
| immune1
| immune2
 ...
| immune<n>)
Debuffs to which the NPC is immune ✔️ Poisoned / Frostburn The $immune1/etc. parameters are deprecated, instead use only the $immune parameter. Separate multiple debuff names with a slash (/).

All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.

| immuneall Immunity to all debuffs ✔️ yes All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.
| immuneallnotwhips Immunity to all debuffs except whip debuffs ✔️ yes
| immuneallnote
 or
| immunenote
Addition to $immuneall/$immuneallnotwhips Will be directly appended to the text that is displayed if $immuneall/$immuneallnotwhips is set.

Example: <br/><span style="color:#666;">(except {{item|Stunned|scale=0.5}})</span>

All immunity-related information will only be displayed if $type does not contain Projectile, Invincible, and Critter.

Buff- & Debuff-related parameters

Buff- & Debuff-related parameters
| buff Buff that the NPC causes Dryad's Blessing Name of the buff. As a shortcut for $buffduration, $buffchance, and $buffmode, they can be appended to this value, separated with a slash: | buff = <name> / <duration> / <chance> <mode>. Chance and mode may also be omitted, and only the standard mode values[1] are allowed.

Examples:

  • Regeneration / 5 / 50% #expert (The NPC grants the Regeneration buff for 5 seconds with a chance of 50%, but only in Expert and Master Mode.)
  • Ironskin @normal (The NPC grants the Ironskin buff in Classic Mode. Duration and chance information can be passed in their respective parameters.)
| idbuff Buff ID ✔️
| bufflink Buff link target ✔️
| bufftip Buff tooltip ✔️
| buffchance Buff chance
| buffduration Buff duration Enter the value using the {{duration}} template.
| buffmode Mode-exclusivity of the buff Can be one of the standard mode options[1] or expert, master, or expertonly. The buff will only be displayed in the respective tab(s). By default, it will be displayed in all three tabs.
| buffidshow Vanity buff ID
| buff<n> Additional buff that the NPC causes Can be continued nearly infinitely, e.g. buff2, buff3, etc.
| idbuff<n> Buff ID
| bufflink<n> Buff link target
| bufftip<n> Buff tooltip
| buffchance<n> Buff chance
| buffduration<n> Buff duration
| buffmode<n> Mode-exclusivity
| buffidshow<n> Vanity buff ID
| debuff Debuff that the NPC inflicts See above. Debuffs and buffs are handled identically.
| iddebuff Debuff ID ✔️
| debufflink Debuff link target
| debufftip Debuff tooltip ✔️
| debuffchance Debuff chance
| debuffduration Debuff duration
| debuffmode Mode-exclusivity of the debuff
| debuffidshow Vanity debuff ID
| debuff<n> Additional debuff that the NPC causes Can be continued nearly infinitely, e.g. debuff2, debuff3, etc.
| iddebuff<n> Debuff ID
| debufflink<n> Debuff link target
| debufftip<n> Debuff tooltip
| debuffchance<n> Debuff chance
| debuffduration<n> Debuff duration
| debuffmode<n> Mode-exclusivity
| debuffidshow<n> Vanity debuff ID

Drop-related parameters

Drop-related parameters
| money Base amount of money that the NPC drops ✔️ {{coin|3gc 80sc}} Use the {{coin}} template.
| money2 Addition to dropped money Will be directly appended to $money.
| <item name 1>
| <item quantity 1>
| <item rate 1>


| <item name 2>
| <item quantity 2>
| <item rate 2>

...

| <item name n>
| <item quantity n>
| <item rate n>

Dropped item |Gel|2–5|{{modes|75%|100%}}


|Eye of Cthulhu Relic||{{master|100%}} @master

Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Repeat this triple of parameters as many times as necessary.


Use {{modes}} to mark drop amounts or rates as exclusive to certain modes.
Append one of the standard mode values[1] to the drop rate to mark the entire item drop as exclusive to certain modes. By default, an item drop will be displayed in all three tabs.


The data, i.e., the name of the NPC, item, quantity, rate, and mode, will be stored to cargo to enable the functionality of {{drop infobox}}.

|:group:start
| <group heading>
| <group mode>


| <group item name 1>
| <group item quantity 1>
| <group item rate 1>


| <group item name n>
| <group item quantity n>
| <group item rate n>

...

|:group:end
|---------
|---------

Group of dropped items |:group:start|Only one of the following 4 will drop|@normal

...

|:group:end|---------|---------

Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Visually groups dropped items. See most bosses' pages, e.g. Queen Bee, for examples.

|:loot:start
|---------
| <loot mode>

...

|:loot:end
|---------
|-

Subgroup of a dropped item Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Used for creating an indented list of dropped items, mainly used for Treasure Bag contents. Supports the group construct from above. See most bosses' pages, e.g. Queen Bee, for examples.

All items inside the section will be stored to cargo with the name of the item directly above the section, instead of the name of the NPC as usual. For example, preceding a loot section on Wall of Flesh that contains the Demon Heart with Treasure Bag (Wall of Flesh) will store the dropping entity of the Demon Heart as "Treasure Bag (Wall of Flesh)" instead of "Wall of Flesh", as would be the case with all items outside the loot section.

| custom:<raw item name(s)>
| <custom item display>
| <item rate>
Custom dropped item Note that these are unnamed parameters, i.e., they are not used with an equals sign (=) like the other parameters.


Grants custom control over $<item name> and $<item quantity>. See Guide for an example. The first parameter should be followed by the raw names of the items that receive a custom formatting (separate multiple with a slash (/) character). Although this is not necessary for a correct output, it ensures that the row's data is correctly stored to cargo and can thus be displayed by {{drop infobox}}.

Sound-related parameters

Sound-related parameters
| soundhurt Hurt sound effect ✔️ NPC_Hit_1.wav Can be a comma-separated list for multiple sounds. Caption is "Hurt". Set to an empty value (|soundhurt=) to hide the automatically generated sounds.
| soundkilled Killed sound effect ✔️ NPC_Killed_1.wav Can be a comma-separated list for multiple sounds. Caption is "Killed". Set to an empty value (|soundkilled=) to hide the automatically generated sounds.
| sound1 Custom additional sound effect Can be a comma-separated list for multiple sounds.
| soundcaption1 Caption for the sound effect
| soundmode1 Mode-exclusivity of the sound effect expert Can be expert, master, or expertonly. The sound(s) will only be displayed in the respective tab (both Expert and Master if set to expert). By default, a sound will be displayed in all three tabs.
| sound2 Custom additional sound effect See above. These parameters behave in the exact same manner.
| soundcaption2 Caption for the sound effect
| soundmode2 Mode-exclusivity of the sound effect
| sound<n> Custom additional sound effect Can be continued nearly infinitely. Sounds will only be displayed if there is a sound<n> parameter with a corresponding soundcaption<n> parameter.
| soundcaption<n> Caption for the sound effect
| soundmode<n> Mode-exclusivity of the sound effect

Back-end-related parameters

Back-end-related parameters
| cate Toggles all categorization no Set to yes to force categorization when it is disabled by default (on non-mainspace pages). Set to no to disable categorization.
| listcat
 (deprecated:
| listcat2)
Categorization Supplemental category names (Category:<$listcat> NPCs). Separate multiple with a slash (/).

Note: The template mainly categorizes the page based on the $type, $environment, and $ai parameters. Therefore, it is often not necessary to add a $listcat.

| allversions Platform version availability ✔️ no Set to yes to assert that the NPC is available on all platforms of Terraria. This is only to be used if no {{exclusive}} banner is on the page. If omitted, it will be detected automatically based on the result of {{eversions|<NPC name>}} (even though $auto might not be set!). Categorizes the page in all five version content categories (with the exception of Category:Japanese console content), if yes is determined.
| hardmode Hardmode-exclusivity yes Set to yes to assert that the NPC is not available in pre-Hardmode, but only becomes available in Hardmode. Categorizes the page in Category:Hardmode-only NPCs.
| cargo Toggles cargo data storage no Set to yes to force cargo data storage when it is disabled by default (on non-mainspace root pages[2]). Set to no to disable cargo data storage.
| cargodrops Toggles drops cargo data storage no By default, dropped item data will be stored to cargo if $cargo, i.e., main cargo data storage, is enabled. Use this parameter to override that.

A frequently used example is in cases where an enemy with multiple parts, e.g. a worm, does not store its main infobox data to cargo (since only the individual parts should be stored), but contains the drop information in the main infobox, which should be stored to cargo. $cargo will be no in this case, and $cargodrops will be yes.

| idcargo NPC ID to store to cargo 201 Can be a comma-separated list. Can also be left empty to prevent cargo storage as well.
| imagecargo NPC image to store to cargo [[File:Skeleton.png]] Define an image to store to cargo, completely overriding the image parameters.

Subpages

There are numerous supplemental subpages which are mainly used for formatting certain data:

See also

Footnotes

  1. 1.0 1.1 1.2 The following values are available:
    • @normal – Classic Mode only
    • @expert – Expert Mode only
    • @master – Master Mode only
    • #normal – Classic and Expert Mode only
    • #expert – Expert and Master Mode only
  2. A root page is a page that is not a subpage. This prevents language subpages from storing duplicates by default.


Advertisement