Template:GetItemInfo

From Terraria Wiki
(Redirected from Template:Iteminfo)
Jump to: navigation, search
This template is i18n-ready, which means it is easy to localize for different languages. Please see I18n & l10n for Templates to learn more.
Lua logo.svg
This template uses Module:Iteminfo, a script written in the Lua programming language. Please see wikipedia:Lua and mw:Extension:Scribunto to learn more about Lua.
Template-info.svg Documentation The documentation below is transcluded from Template:GetItemInfo/doc. (edit | history)

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

Usage[edit source]

{{ iteminfo | <ID or name of the item> | <specific stat> | format=y/yes (optional) | raw=y/yes (optional) }}

Special: {{iteminfo||count}} results in: 3929

First unnamed parameter / id

Name or ID of the item. If it is the ID of the item, id= can be used.

Second unnamed parameter / field

Specific stat to be displayed; see the tables below for valid values.

See below for how to output all stats.

Original raw variable name Alias Note
case-sensitive if raw=yes,
case-insensitive otherwise
type id / item id / itemId Item ID of the item
name name of the item.
internalName internal name Internal name of the item.
DD2Summon If set, it means this item is an item related to the Old One's ArmyDesktop VersionConsole Version, and the buy price will be calculated using Defender Medals instead of Gold Coins. 1 Defender Medal = 1 Gold Coin.
accessory acc If set, this is an accessory item.
ammo AmmoID (used in field useAmmo) not only, e.g. 353, 154
autoReuse auto / autoSwing If set, this item is capable of autoswing.
axe axe power / axePower Axe Power.
bait bait power / baitPower Bait power.
buffTime buffDuration / buff duration Time the buff this item grants will be in effect.
buffType buffId / buff id Buff ID of the buff this item grants.
buff / buff name / buffName Name of the buff this item grants.
cartTrack Is set for Minecart Tracks.
channel If set, means that the item can/needs be used continuously ("channeling cast", different from autoswing, though!) Is set for Flails and Yoyos, Chainsaws and Drills, Magic Missile and its upgrades, Dirt Rod, Piranha Gun, Chlorophyte Jackhammer, Laser Machinegun, Charged Blaster Cannon, Flying Knife, Medusa Head, Arkhalis, Portal Gun, Vortex Beater, Phantasm, The Grand Design, Last Prism, Sleepy Octopod, Ghastly Glaive, Phantom Phoenix, Sky Dragon's Fury. Is also set for certain Pet/Light Pet/Mount summoning items, since they will continuously be in effect.
consumable Is set for items that are consumables (which means all items in Category:Consumable items). Note that this is distinct from the ingame concept "Consumable"! See Category:Consumable items for clarification. If this attribute is set to True, then one item from the stack is removed each time the item is used.
createTile tile / tileId / tile id Tile ID of the tile this item produces when placed.
placeStyle tile sub id / tile subid / tileSubId Sub ID of the Tile ID.
createWall wall / wallId / wall id Wall ID of the wall this item produces when placed.
crit critical Critical strike chance of the item.
damage dmg Base damage of the item.
defense Defense this item grants.
dye If non-zero, this is a dye item.
expert If set, this item will be displayed as Rainbow Rarity.
fishingPole fishingPower / fishing power Fishing Power of the item.
flame Set for each kind of Torch and for Water, Peace, Platinum, and regular Candle. Interestingly, it is also set for Brand of the Inferno.
hairDye hair dye 0 for Hair Dye Remover and positive number for other Hair Dyes.
hammer hammer power / hammerPower Hammer power.
healLife Amount of Health Points this item restores when used.
healMana Amount of Mana this item restores when used.
holdStyle Can only be a value between 0 and 3. Is set to 1 for each kind of Torch and Water, Peace, Platinum, and regular Candle, Sticky, Bouncy, Spelunker and regular Glowstick, Ale, Unicorn on a Stick, Flare Gun, Marshmallow on a Stick, Nebula Arcanum. Is set to 2 for Breathing Reed, Umbrella. Is set to 3 for Magical Harp.
knockBack kb Knockback value of the item.
lifeRegen Can only be 0 or 1. Is set to 1 for Band of Regeneration and Charm of Myths.
makeNPC If non-zero, will spawn NPC when used. The value is the NPC ID of the spawned NPC.
mana Amount of Mana this item consumes upon use.
maxStack stack Maximum stack limit.
mech If set, this is a mechanism item, which means that it shows wire and Actuators when held.
melee damagetype If set, this item deals melee damage.
magic If set, this item deals magic damage.
ranged If set, this item deals ranged damage.
summon If set, this item deals summon damage.
thrown If set, this item deals thrown damage.
mountType mount / mountid / mount id Mount ID of the mount this item summons when used.
noMelee Whether this item is allowed to deal damage with its sprite. Typically set to true for a ranged weapon, which would rely on its projectiles to deal damage, instead.
noUseGraphic Whether this item's sprite is drawn while it is in use. Thrown weapons like Dynamite uses this, because it is immediately tossed to the ground to create the illusion of being used.
noWet If set, the item cannot be held/placed underwater: Unicorn on a Stick, every kind of Candle and every kind of Torch (without Cursed and Ichor Torch). However, is also set for Timers which can be placed underwater.
notAmmo Is only set for Coins, Ale, Wire. Aside from Wire, these share the trait of not being able to be put in the ammo slot of the inventory, even though there are used as ammunition. Wire can be placed in that slot, though.
paint If not 0, it means the item is Paint. The value is some sort of internal "Paint ID", ranging from 1 (Red Paint) to 30 (Negative Paint).
pick pick power / pickPower / pickaxe / pickaxe power / pickaxePower Pickaxe power.
potion If set, no other items with this attribute may be used until the cooldown elapses. This applies to healing items and Mushrooms.
rare rarity Rarity of the item. Not valid if expert is set, as that makes the item have the Rarity level: Rainbow rarity.
reuseDelay usedelay / use delay The time in ticks before this item may be used again, commonly called "Use Delay". There are 60 ticks in one second. Currently only set for Clockwork Assault Rifle, Medusa Head, Last Prism, Sky Fracture, and Betsy's Wrath.
sentry If set, this item is a sentry summon item.
shoot projectileId / projectile id If non-zero, this is the Projectile ID of the projectile fired by the item.
shootSpeed velocity Velocity of the projectile fired by the item.
stringColor The color type of Strings, only for String items.
tileBoost Range bonus.
tileWand tile wand Item ID of the block this Block-placing wand places.
questItem Is only set for Quest Fish.
uniqueStack Is only set for Quest Fish. See Fishing#Fishing Quests for details regarding the special quality of these items.
useAmmo Type of ammunition this item uses.
useAnimation use / usetime / use time Use time of the item. Note that this value is not correct for swords with autoswing capabilities; the actual in-game use time of those weapons is useAnimation-1. The template currently does not consider this, which leads to an incorrect result for those weapons.
useStyle use style Use style of the item.
useTime tool speed / toolspeed Tool speed for tools, (internal) use time for others. How long it takes to use the item, in ticks. While the item is in use, you cannot take other actions.
useTurn Whether the player will turn to face the direction the player is moving when the item is used. For example, a sword would make you face left or right, but a spear would not.
value buy / price Buy value. If DD2Summon is set, it will display the price in Defender Medals. Note that this might output a value even if the item cannot be bought!
sell Sell value. Note that there is no original variable for this stat, because the game just divides an item's buy value by 5 to determine its sell value. Use {{#expr:floor({{iteminfo|item|value|raw=yes}}/5)}} to receive a raw, numerical value for the sell value.
Another alias is value. Due to its ambiguity with the original variable possibly causing confusion, it is now deprecated. Although it may still be used on some pages, it should no longer be used.
vanity If set, this item is a vanity item.
format = y/yes

Use this parameter to wrap the output 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, for instance for further calculations with the {{#expr:}} parser function. See Module:Iteminfo 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]

Specific stats[edit source]

  • The Regeneration Potion grants the [[{{iteminfo|Regeneration Potion|buff}}]] buff for {{iteminfo|289|buff duration}} and can be sold for {{iteminfo|Regeneration Potion|sell}}.
results in:
The Regeneration Potion grants the Regeneration buff for 5 minutes and can be sold for 200*2 Silver Coin.png.
  • {{iteminfo|Ballista Cane|price}} results in: 25 Defender Medal
  • {{iteminfo|Ballista Cane|sell}} results in: 50000*5 Gold Coin.png

All stats[edit source]

Use {{iteminfo/all}} or {{getItemInfo/all}} to display a box with all available stats of an item. Takes only one parameter – the ID or name of the item.

  • {{iteminfo/all|Terra Blade}} results in:
Terra Blade (ID = 757) Info:
type: 757
name: Terra Blade
internalName: TerraBlade
DD2Summon:
ToolTip:
material:
accessory:
ammo: 0
autoReuse: 1
axe: 0
bait: 0
buffTime: 0
buffType: 0
cartTrack:
channel:
consumable:
createTile: -1
placeStyle: 0
createWall: -1
crit: 0
damage: 95
defense: 0
dye: 0
expert:
fishingPole: 0
flame:
hairDye: -1
hammer: 0
healLife: 0
healMana: 0
holdStyle: 0
knockBack: 6.5
lifeRegen: 0
makeNPC: 0
mana: 0
maxStack: 1
mech:
melee: 1
magic:
ranged:
summon:
thrown:
mountType: -1
noMelee:
noUseGraphic:
noWet:
notAmmo:
paint: 0
pick: 0
potion:
rare: 8
reuseDelay: 0
sentry:
shoot: 132
shootSpeed: 12
stringColor:
tileBoost: 0
tileWand: -1
questItem:
uniqueStack:
useAmmo: 0
useAnimation: 16
useStyle: 1
useTime: 16
useTurn:
value: 1000000
vanity:

See also[edit source]