TModLoader v1.4.4.9
TModLoader source code documentation
Loading...
Searching...
No Matches

◆ instanced

bool Terraria.Item.instanced

If true, then the given item is instanced per-client.
Instanced items only appear on the client they were spawned on and are less likely to be replaced if a new item is spawned.
Instanced items do not exist on servers.
Vanilla uses this field for treasure bags and Defender Medals. tModLoader automatically handles this for modded treasure bags.
If you would like to make an instanced item, see any one of the following for examples:

  • M:Terraria.NPC.DropItemInstanced(Microsoft.Xna.Framework.Vector2,Microsoft.Xna.Framework.Vector2,System.Int32,System.Int32,System.Boolean)
  • M:Terraria.GameContent.ItemDropRules.CommonCode.DropItemLocalPerClientAndSetNPCMoneyTo0(Terraria.NPC,System.Int32,System.Int32,System.Boolean)
  • F:Terraria.ID.MessageID.InstancedItem
    Defaults to false.

Definition at line 332 of file Item.cs.

Referenced by Terraria.Item.ResetStats(), and Terraria.Item.UpdateItem().