Changes

Jump to navigation Jump to search
→‎Item spawn fields: add info on auto-generated ID, add GenericSpawnItemData to intro
Line 4,950: Line 4,950:     
====Item spawn fields====
 
====Item spawn fields====
Several data assets (like [[#Custom machines|machines]] and [[#Custom shops|shops]]) let you configure items to create. For consistency, these all share a set of common fields (internally represented by <samp>ISpawnItemData</samp>):
+
Several data assets (like [[#Custom machines|machines]] and [[#Custom shops|shops]]) let you configure items to create. For consistency, these all share a set of common fields (internally represented by <samp>GenericSpawnItemData</samp> and <samp>ISpawnItemData</samp>):
    
{| class="wikitable"
 
{| class="wikitable"
Line 4,959: Line 4,959:  
| <samp>ID</samp>
 
| <samp>ID</samp>
 
| A unique identifier for this entry (not the item itself) within the current list. The ID should only contain alphanumeric/underscore/dot characters. For custom items, this should be prefixed with your mod ID like <samp>Example.ModId_Parsnips</samp>.
 
| A unique identifier for this entry (not the item itself) within the current list. The ID should only contain alphanumeric/underscore/dot characters. For custom items, this should be prefixed with your mod ID like <samp>Example.ModId_Parsnips</samp>.
 +
 +
This is semi-optional — if omitted, it'll be auto-generated from the <samp>ItemId</samp>, <samp>RandomItemId</samp>, and <samp>IsRecipe</samp> fields. However multiple entries with the same ID may cause unintended behavior (e.g. shop items reducing each others' stock limits), so it's often a good idea to set a globally unique ID instead.
 
|-
 
|-
 
| <samp>ItemId</samp>
 
| <samp>ItemId</samp>
translators
8,456

edits

Navigation menu