Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
Line 455: Line 455:
     <td scope="row"><div class="tt" data-tt-id="p_miningspeed" data-tt-parent="root">miningspeed</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_miningspeed" data-tt-parent="root">miningspeed</div></td>
     <td>key: string, value: decimal number</td>
     <td>key: string, value: decimal number</td>
     <td></td>
     <td>-</td>
     <td>The mining speed for each material.</td>
     <td>The mining speed for each block material.</td>
     <td>pickaxe</td>
     <td>pickaxe, shovel</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_miningspeed_info" data-tt-parent="p_miningspeed" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_miningspeed_info" data-tt-parent="p_miningspeed" data-invisible="true"></div></td>
     <td colspan="4">
     <td colspan="4">
Materials types are hardcoded into blocks, and include the following types:
Materials types are hard-coded into blocks, and include the following types:


''soil, gravel, sand, wood, leaves, stone, liquid, snow, ice, metal, mantle, plant, glass, ceramic, cloth, lava, brick, fire, other''
''soil, gravel, sand, wood, leaves, stone, liquid, snow, ice, metal, mantle, plant, glass, ceramic, cloth, lava, brick, fire, other''
Line 484: Line 484:
     <td>integer</td>
     <td>integer</td>
     <td>0</td>
     <td>0</td>
     <td>Determines which blocks it can break. If the required miningtier is above the defined one there will be no drop from it.</td>
     <td>Determines which tier of blocks the item can break. If the block tier is above the one defined here nothing will be dropped from it when broken. Also determines the damage tier of a weapon, which is contested against armor tiers.</td>
    <td>pickaxe, sword</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 494: Line 495:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_attributes" data-invisible="true"></div></td>
     <td colspan="3">
     <td colspan="4">
Extra attributes added to a item or block. Those are final and cannot be modified. It's a good way to keep things organized and and modifiable. The '''oreblastingbomb''' for example has attributes, which define its radius and type. These can be used by behaviors and blockentities:
Attributes constitute a large number of optional properties that an item can have, many of which are specific to unique items that rely on classes for their functionality. This includes custom values that can be utilized by an item class assigned to your own custom items.
 
Values placed here are final and cannot be modified. For example, if you made a new type of weapon, say a mace that had additional weapon properties (used in an ItemMace class) you could define them here:
 
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
     attributes: {
     attributes: {
"blastRadius": 4,
"armordamage": 10,
"blastType": 0,
"stunchance": 0.1,
},
},
</syntaxhighlight>
</syntaxhighlight>
Here we have made two new attributes called "armordamage" and "stunchance" and have given them their own static values to be used in code. As is, these cannot do anything without the usage of C# code in a class. Regardless, we can see that this is a convenient way to create new versions of an existing item.
</td>
    <td colspan="4">
A complete list of existing attributes are listed here:
</td>
</td>
   </tr>
   </tr>
219

edits