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

◆ ResearchUnlockCount

int Terraria.Item.ResearchUnlockCount
getset

A utility property for easily getting or setting the amount of items required for this item's current type to be researched.
By default, all modded items will have this set to 1. Set to 0 for un-researchable items, such as items that disappear on pickup. The Journey Mode Research wiki pagelists values for various types of items, use it as a guide for consistency.
NOTE: The accessed values are stored per item type, not per item instance. You're recommended to only use the setter in load-time hooks, like M:Terraria.ModLoader.ModType.SetStaticDefaults.

Definition at line 1135 of file Item.cs.

1136 {
1137 get
1138 {
1139 if (!CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId.TryGetValue(type, out var result))
1140 {
1141 return 0;
1142 }
1143 return result;
1144 }
1145 set
1146 {
1147 if (value < 1)
1148 {
1149 CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId.Remove(type);
1150 }
1151 else
1152 {
1153 CreativeItemSacrificesCatalog.Instance.SacrificeCountNeededByItemId[type] = value;
1154 }
1155 }
1156 }
int value
The number of copper coins this item is worth (aka, cost to buy from a merchant). Setting it to 10462...
Definition Item.cs:655
int type
The Item ID of this item. The Item ID is a unique number assigned to each Item loaded into the game....
Definition Item.cs:345