Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
Line 226: Line 226:
</tr>
</tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Specific</b></td>
     <td colspan="5" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Specific</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 232: Line 232:
     <td>string</td>
     <td>string</td>
     <td>&quot;item&quot;</td>
     <td>&quot;item&quot;</td>
     <td>The item class can add special functionalities for the item.</td>
     <td>The class an item should use if it has additional C# functionalities that can't be accomplished with JSONS.</td>
    <td>axe-metal, hoe, spear</td>  
   </tr>
   </tr>
   <tr>
   <tr>
Line 244: Line 245:
     <td>integer</td>
     <td>integer</td>
     <td>0</td>
     <td>0</td>
     <td>How many uses does this item has when being used. Item disappears at durability 0.</td>
     <td>The maximum uses of the item. Items that reach 0 uses disappear. NOTE: The actual current durability of the item is stored as a treeAttribute, this is only a max value. </td>
    <td>pickaxe</td>   
   </tr>
   </tr>
   <tr>
   <tr>
Line 251: Line 253:
     <td>-</td>
     <td>-</td>
     <td>From which damage sources does the item takes durability damage.</td>
     <td>From which damage sources does the item takes durability damage.</td>
    <td>pickaxe</td> 
   </tr>
   </tr>
   <tr>
   <tr>
Line 257: Line 260:
     <td>0</td>
     <td>0</td>
     <td>Mining a block.</td>
     <td>Mining a block.</td>
    <td>pickaxe</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 263: Line 267:
     <td>1</td>
     <td>1</td>
     <td>Hitting an entity.</td>
     <td>Hitting an entity.</td>
    <td>sword</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 269: Line 274:
     <td>2</td>
     <td>2</td>
     <td>Currently not used.</td>
     <td>Currently not used.</td>
    <td>-</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 274: Line 280:
     <td>string</td>
     <td>string</td>
     <td>-</td>
     <td>-</td>
     <td>If set, this item will be classified as given tool.</td>
     <td>Classifies the item as the given tool, which gives it the ability to harvest resources from certain blocks.</td>
    <td>axe-metal, pickaxe, knife, scythe, shovel</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 280: Line 287:
     <td></td>
     <td></td>
     <td>0</td>
     <td>0</td>
     <td>USed to break grass.</td>
     <td>Can harvest items from grass.</td>
    <td>knife, scythe</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 287: Line 295:
     <td>1</td>
     <td>1</td>
     <td>Can mine rock and other stone materials</td>
     <td>Can mine rock and other stone materials</td>
    <td>pickaxe</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 292: Line 301:
     <td></td>
     <td></td>
     <td>2</td>
     <td>2</td>
     <td>Useful for chopping trees.</td>
     <td>Can chop down trees and other wood materials.</td>
    <td>axe-metal, axe-stone</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 299: Line 309:
     <td>3</td>
     <td>3</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>sword</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 304: Line 315:
     <td></td>
     <td></td>
     <td>4</td>
     <td>4</td>
     <td>Mines dirt, sand and gravel really fast.</td>
     <td>Can dig soil, gravel and sand quickly.</td>
    <td>shovel</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 311: Line 323:
     <td>5</td>
     <td>5</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>hammer</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 317: Line 330:
     <td>6</td>
     <td>6</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>-</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 323: Line 337:
     <td>7</td>
     <td>7</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>spear</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 329: Line 344:
     <td>8</td>
     <td>8</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>bow</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 335: Line 351:
     <td>9</td>
     <td>9</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>-</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 341: Line 358:
     <td>10</td>
     <td>10</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>hoe</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 347: Line 365:
     <td>11</td>
     <td>11</td>
     <td>No special abilities yet.</td>
     <td>No special abilities yet.</td>
    <td>saw</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td>
     <td colspan="5" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 376: Line 395:
'''<code>*</code>''' reprents the variants which will be added. You can specify multiple and separate them with a comma. It follows the same way as the '''byType''' property.
'''<code>*</code>''' reprents the variants which will be added. You can specify multiple and separate them with a comma. It follows the same way as the '''byType''' property.


A '''Torch''' on the other hand only adds the variation '''<code>up</code>''':
However, sometimes you may only want to show a single variant of your block or item (such as one that has multiple directional variants). In this case, you can set a specific variant to show up, once again using similar syntax to the variant code.
 
For example, a '''Torch''' only adds the variation '''<code>up</code>''', since the block uses a class to determine which direction it will be placed in regardless of the variant used:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
creativeinventory: { "general": ["*-up"], "decorative": ["*-up"] },
creativeinventory: { "general": ["*-up"], "decorative": ["*-up"] },
219

edits