Surfpup's tConfig Mod Wiki

Item Class

124pages on
this wiki
Add New Page
Comments43 Share
The information in this article is for Terraria v1.0.6.1.

Items are the most prevalent thing to make changes to. There are a ton of attributes for you to play with, such as their size, damage, effects, recipe, and the like.

Some of the many items you can make changes to

Read More


Name Type Description
accessory bool Whether the item is an accessory or not.
active bool Whether this item is active in the game world. If not, it may be overwritten by a new item.
alpha int The alpha value for when the item is draw
ammo int The type value of the kind of ammo that this item uses. Refer to the List of Ammo for more details.
ammoName string As "ammo", but you give it an exact name instead of the number. Use either, but not both. Typically you use this for custom ammo and projectiles.
autoReuse bool Indicates that the item will continue to be used if the mouse is held down
axe int How much power the item has, if its an axe. Internally, values are multiplied by 5. Thus, a copper axe has 7, which becomes 35.
beingGrabbed bool Whether this item is on the ground, and in the process of being collected by a player.
bodySlot int The game sets this to -1 by default, and each type of armor seems to have its own value that it changes to. For example, Copper Chainmail is 1, Iron Chainmail is 2, etc. Setting to -2 will indicate this is a custom set of armor.
buffTime int How long an applied buff should last.
buffType int The ID of the buff to apply when the item is used.
buy bool Seems to be a flag that checks if you're hovering the item in a vendor's inventory.
buyOnce bool A flag to see if the item should be bought
channel bool Whether the item has a channeled use. An Aqua Scepter has a short use time and casts many times in a short period. An item like Magic Missile is channeled, as one spellcast could last a very long time as you control it.
color Color Written as 4 numbers separated by commas, representing Red, Green, Blue, and Alpha attributes. The color attribute is only used for certain items, such as the different types of Pickaxes, which all have a different color, but identical sprite.
consumable bool If set to true the item will be consumed on use.
createTile int The ID number of the tile this item should create on use.
createTileName string The name of the tile this item should create on use. Typically used with custom tiles.
createWall int The ID number of the wall this item should create on use.
createWallName string The name of the wall this item should create on use. Typically used with custom walls.
damage int How much damage this item does as a weapon. Remember to set "ranged", "magic", or "melee" to true as well!
defense int How much defence the item gives. Remember that 2 defence reduces damage by 1!
hammer int How much power the item has as a hammer for removing tiles.
hasArms bool If true, it will load and use the image itemname + " Arms.png"
hasHands bool If true, the player's hands will not be drawn. Many metal armors have hands, and have gloves associated with their sprite.
headSlot int As with bodySlot, each armor has a unique value when equipped. Set to -2 to indiciate custom armor.
healLife int How much life is restored on use.
healMana int How much mana is restored on use.
height int Hitbox height of the item. Equal to the sprite's (height * scale).
holdStyle 1 How the item is held when it is selected.

  • 0 - Default
  • 1 - Candles, torches, etc.
  • 2 - Breathing reed
keepTime int Decreases every step, and when 0 or less, finds the appropriate owner. Not sure how you would use this effectively.
knockBack 300 How strong the knockback on the item when it is used as a weapon.
lavaWet bool Whether item has been submerged in lava. Certain items will be destroyed if this is the case.
legSlot int As with bodySlot, different items have different IDs while equipped. -2 indicates custom armor.
lifeRegen int Represents whether the ring of regeneration is equipped, setting it to 0 if not, and 1 if it is.
light float Power of light emitted from this item. A value between 1f and 8f is probably appropriate, although every item currently has -1 in the current build of tConfig by default.
magic bool Whether this item's damage is considered magical. Melee has precedence over ranged over magic.
mana int How much mana is consumed when you use this item.
manaIncrease int How much the player's mana increases when this item is equipped. Doesn't seem to be referenced in main, item or player classes, and has a default of 0.
material bool If true, item will be marked as "Material" when you hover over it.
maxStack int The maximum number of items of this type that you can hold in a stack.
melee bool Whether this item's damage is considered melee. Melee has precedence over ranged over magic.
name 213the Name of the item. You probably don't want to change this since many effects are based off an item's name. However, you can definitely compare values with it.
noGrabDelay int How long the item has to rest on the ground until it can be picked up by a player. Default is 100 ticks.
noMelee bool Whether collision with the item sprite will cause damage. Bows and spells for example, would set this to true, since their damage works on projectiles.
noUseGraphic bool Whether or not to draw the graphic when the item is used. You might want to use this for thrown weapons, such as grenades.
noWet bool Seems to only be referenced from light sources like torches and candles. If wet, they won't show up when held.
owner int The ID of the player who owns the item. Default value is 255 if no owner.
ownIgnore int Related to finding the owner and usually defaults to -1. Probably don't need to touch this variable.
ownTime int How long the item has been owned? Every tick decreases this value by 1, if its above 0.
pick int How much power the item has when used as a pickaxe.
placeStyle int How the item is placed as a tile. You'll want to refer to the graphics for this. Basically the index of the graphic file (so how a torch "knows" to hang in a certain direction for example - it uses this)
position Vector2 The XY position of the object in the world.
potion bool Whether this item will cause the potion sickness debuff. If you have the debuff, you can't use items that share this property.
projectile string Used for custom projectiles only, this property cannot be used in code files, but the shoot property will always be valid instead. You supply it the name of that item as a string.
ranged bool Whether the item deals ranged damage or not. Melee has precedence over ranged over magic.
rare int A value which indicates the color the item should be when highlighted.

  • 0 - White
  • 1 - Blue
  • 2 - Green
  • 3 - Purple
  • 4 - Orange
release int ???
scale float A decimal representing how large to scale the item's graphic.

  • 0.5 - Half size
  • 1.0 - Normal size
  • 2.0 - Double size
setName string The name of the set that this item belongs to.
shoot int Which existing projectile to shoot on use. Please refer to the List of Projectiles. If using a custom projectile, use the "projectile" attribute above.
shootSpeed float How fast a created projectile travels. Works for both existing and custom projectiles.
social bool ???
spawnTime int ???
stack int How many items are in the slot. Typically capped at 99 or 250, but there's no reason you can't change the maximum!
tileBoost int ???
toolTip string The first line of text displayed when you hover the item with an open inventory.
toolTip2 string The second line of text displayed when you hover the item with an open inventory.
type int When set to an existing item, it will behave and look just like that item. For your custom items, you will want this set to -1 always.
useAmmo int The type value of ammo to use.
useAmmoName string As above, but for custom ammunition.
useAnimation int How many ticks it takes to complete one use animation.

  • 30 ticks = 1 second
useSound int Sound to play each time the item is used
useStyle int

Which animation to play when you use it

  • 1 - Overhand swing (like most swords)
  • 2 - Underhand swing (i.e. eating/drinking something)
  • 3 - Stab (as with a shortsword)
  • 4 - Hold up diagonally (using items)
  • 5 - Shoot gun / stab (as with the spears)
useTime int How many ticks it takes to complete one use of the item/

  • 30 ticks = 1 second
  • If this is smaller than useAnimation, it will trigger two or more times per click!
useTurn bool Whether the player can turn around while using the item. Most items have this set to true.
value int The value of the item, expressed as copper coins.

  • 000000CC - Copper
  • 0000SS00 - Silver
  • 00GG0000 - Gold
  • PP000000 - Platinum

For example, "5600" would mean 56 silver coins.

vanity bool Sets the "Vanity"status
velocity Vector2 How many pixels the item travels every tick. This is affected by gravity, friction, etc, and gradually slows down to 0. However, you could set Y = -20f to fling it upwards, for example.
wet bool Used for torches, to tell if they are lit or not, underwater.
wetCount byte ???
wetLight float Used if item produces light underwater or not.
width int Hitbox width of the item. Equal to the sprite's (width * scale).
wornArmor bool ???

Static PropertiesEdit

Name Type Description
None None None


Method Name Description
public bool checkMat()

For this item, checks if it is used in any recipes. If so, then this.material is set to true and the method returns true. Generally you don't really need to call this, but it might be useful in some cases.

  • Returns ??? as bool
public object Clone()

Returns a copy of the instance as an object.

  • Returns a new instance of the object
public void FindOwner(int whoAmI)

You give this method the player index from Main.player[]. Typically, this is Main.myPlayer. When called, it updates the item's position so that it moves closer to the player every step, like when items get sucked towards you when you pick them up.

  • Returns no value
public Color GetAlpha(Color newColor)

When given a Color, it determines the difference between alpha values, and returns a new Color based on that.

  • Returns the alpha as Color
public Color GetColor(Color newColor)

Similar to above, this method is given a Color, but it compares red, green, blue, and alpha values before returning a Color.

  • Returns the color as Color
public bool IsNotTheSameAs(Item compareItem)

Returns true if the given item is not the same as this item. Also seems to check the item.stack size for quantity.

  • Returns ??? as bool
public bool IsTheSameAs(Item compareItem)

Returns true if the given is the same as this item. Does not seem to care about stack size in this method.

  • Returns ??? as bool
public void SetDefaults(string ItemName)

Sets all of the item's properties to default values, for the given ItemName.

public void SetDefaults(int Type, [bool noMatCheck = false])

Sets all of the item's properties to default values, for the given Item.type

  • Returns no value
public void UpdateItem(int i)

Updates the item every tick it remains on the ground, such as position, emitted light, etc.

  • Returns no value

Static MethodsEdit

Method Name Description
public static int NewItem(
    int X,
    int Y,
    int Width,
    int Height,
    int Type,
    [int Stack = 1],
    [bool noBroadcast = false]

Creates a new item in the world, located at (X, Y), and returns the whoAmI value of that item as an int. Stack is how many items are in the stack and noBroadCast seems to be related to netplay.

  • Returns the index of Main.item[] as an int
public static string VersionName(string oldName, int release)

You probably won't call this method ever, but for a given game version and old name, converts the item name to what it currently is. For example, if you said "Cobalt Helmet" and set release <= 4, then it would return "Jungle Hat".

  • Returns ??? as string


See also: List of Items

Classes in Terraria

Chest | Cloud | Collision | Dust | Gore | Item | Lighting | Liquid | Main | NPC | Player | Projectile | Recipe | Sign | Star | WorldGen

Ad blocker interference detected!

Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.