Changes

Jump to navigation Jump to search
→‎Define a custom item: switch to HTML <dl> list due to indentation bug
Line 116: Line 116:     
====Define a custom item====
 
====Define a custom item====
:; Overview
+
<dl style="margin-left: 2em;">
:: You can define custom items for most vanilla item types using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. The data asset for each item type has two new fields:
+
<dt>Overview</dt>
:: {| class="wikitable"
+
<dd>
 +
You can define custom items for most vanilla item types using only [[Modding:Content Patcher|Content Patcher]] or [[Modding:Modder Guide/APIs/Content|SMAPI's content API]]. The data asset for each item type has two new fields:
 +
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
Line 130: Line 132:  
|}
 
|}
   −
:: Supported item types:
+
Supported item types:
   −
:: {| class="wikitable"
+
{| class="wikitable"
 
|-
 
|-
 
! item type
 
! item type
Line 202: Line 204:  
|}
 
|}
   −
:: For example, this content pack adds a new Pufferchick item with a custom image, custom gift tastes, and a custom crop that produces it. Note that item references in other data assets like <samp>Data/Crops</samp> and <samp>Data/NPCGiftTastes</samp> use the item ID.
+
For example, this content pack adds a new Pufferchick item with a custom image, custom gift tastes, and a custom crop that produces it. Note that item references in other data assets like <samp>Data/Crops</samp> and <samp>Data/NPCGiftTastes</samp> use the item ID.
   −
:: {{#tag:syntaxhighlight|<nowiki>
+
{{#tag:syntaxhighlight|<nowiki>
 
{
 
{
 
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
 
     "Format": "</nowiki>{{Content Patcher version}}<nowiki>",
Line 249: Line 251:  
}</nowiki>|lang=javascript}}
 
}</nowiki>|lang=javascript}}
   −
:: Most item data assets work just like <samp>Data/ObjectInformation</samp>. For fruit trees, see [[#Custom fruit trees|custom fruit trees]].
+
Most item data assets work just like <samp>Data/ObjectInformation</samp>. For fruit trees, see [[#Custom fruit trees|custom fruit trees]].
 +
</dd>
   −
:; Tools
+
<dt>Tools</dt>
:: Tools are defined in the new <samp>Data/ToolData</samp> asset using this field format:
+
<dd>
 +
Tools are defined in the new <samp>Data/ToolData</samp> asset using this field format:
   −
:: {| class="wikitable"
+
{| class="wikitable"
 
|-
 
|-
 
! index
 
! index
Line 276: Line 280:  
| ''(Optional)'' The asset name for the item's spritesheet.
 
| ''(Optional)'' The asset name for the item's spritesheet.
 
|}
 
|}
 +
</dd>
   −
:; Melee weapons
+
<dt>Melee weapons</dt>
:: Melee weapons are [[Modding:Items#Weapons|defined in <samp>Data/Weapons</samp>]] like before, but you can now add custom behavior by editing the <samp>Data/AdditionalWeaponProperties</samp> asset. This consists of a string → model lookup, where the key is the unqualified [[#Custom items|item ID]] and the value is a model with these fields:
+
<dd>
 +
Melee weapons are [[Modding:Items#Weapons|defined in <samp>Data/Weapons</samp>]] like before, but you can now add custom behavior by editing the <samp>Data/AdditionalWeaponProperties</samp> asset. This consists of a string → model lookup, where the key is the unqualified [[#Custom items|item ID]] and the value is a model with these fields:
   −
:: {| class="wikitable"
+
{| class="wikitable"
 
|-
 
|-
 
! field
 
! field
Line 304: Line 310:  
| ''(Optional)'' '''Unused.'''
 
| ''(Optional)'' '''Unused.'''
 
|}
 
|}
 +
</dd>
 +
</dl>
    
====Error items====
 
====Error items====
translators
8,447

edits

Navigation menu