Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
Line 1,179: Line 1,179:
     <td>false</td>
     <td>false</td>
     <td>If the item can select a liquid while holding it in hand.</td>
     <td>If the item can select a liquid while holding it in hand.</td>
    <td>-</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,226: Line 1,227:
     <td>-</td>
     <td>-</td>
     <td>Information about the items burnable states.</td>
     <td>Information about the items burnable states.</td>
  </tr>
    <td>redmeat, plank, ore-ungraded</td> 
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_burntemperature" data-tt-parent="p_combustibleprops">burntemperature</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_burntemperature" data-tt-parent="p_combustibleprops">burntemperature</div></td>
Line 1,232: Line 1,234:
     <td>-</td>
     <td>-</td>
     <td>The temperature at which it burns in degrees celsius.</td>
     <td>The temperature at which it burns in degrees celsius.</td>
   </tr>
    <td>redmeat, plank, ore-ungraded</td>    
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_burnduration" data-tt-parent="p_combustibleprops">burnduration</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_burnduration" data-tt-parent="p_combustibleprops">burnduration</div></td>
Line 1,238: Line 1,241:
     <td>-</td>
     <td>-</td>
     <td>For how long it burns in seconds.</td>
     <td>For how long it burns in seconds.</td>
  </tr>
    <td>plank, ore-ungraded</td> 
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_heatresistance" data-tt-parent="p_combustibleprops">heatresistance</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_heatresistance" data-tt-parent="p_combustibleprops">heatresistance</div></td>
Line 1,244: Line 1,248:
     <td>500</td>
     <td>500</td>
     <td>How many degrees celsius it can resists before it ignites (not implemented yet).</td>
     <td>How many degrees celsius it can resists before it ignites (not implemented yet).</td>
   </tr>
    <td>redmeat, plank, ore-ungraded</td>    
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_meltingpoint" data-tt-parent="p_combustibleprops">meltingpoint</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_meltingpoint" data-tt-parent="p_combustibleprops">meltingpoint</div></td>
Line 1,250: Line 1,255:
     <td>-</td>
     <td>-</td>
     <td>How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and Melted is set.</td>
     <td>How many degrees celsius it takes to smelt/transform this into another. Only used when put in a stove and Melted is set.</td>
   </tr>
    <td>redmeat, plank, ore-ungraded</td>    
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_meltingduration" data-tt-parent="p_combustibleprops">meltingduration</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_meltingduration" data-tt-parent="p_combustibleprops">meltingduration</div></td>
Line 1,256: Line 1,262:
     <td>-</td>
     <td>-</td>
     <td>For how many seconds the temperature has to be above the melting point until the item is smelted.</td>
     <td>For how many seconds the temperature has to be above the melting point until the item is smelted.</td>
    <td>redmeat, plank, ore-ungraded</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,262: Line 1,269:
     <td>1</td>
     <td>1</td>
     <td>How much smoke this item produces when being used as fuel.</td>
     <td>How much smoke this item produces when being used as fuel.</td>
    <td>plank, ore-ungraded</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,267: Line 1,275:
     <td>integer</td>
     <td>integer</td>
     <td>1</td>
     <td>1</td>
     <td>How many ores are required to produce one output stack.</td>
     <td>How many items are required to produce one output stack.</td>
    <td>nugget, ore-graded</td>  
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,273: Line 1,282:
     <td>object</td>
     <td>object</td>
     <td>-</td>
     <td>-</td>
     <td>If set, the block/item is smeltable in a furnace and this is the resulting itemstack once the MeltingPoint has been reached for the supplied duration.</td>
     <td>If set, the block/item is smeltable and this is the resulting itemstack once the MeltingPoint has been reached for the supplied duration.</td>
    <td>nugget, ore-graded</td>  
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,280: Line 1,290:
     <td>true</td>
     <td>true</td>
     <td>If set to true, the block/item requires a smelting/cooking/baking container such as the Crucible. If false, it can be directly baked/melted without smelting/cooking/baking container.</td>
     <td>If set to true, the block/item requires a smelting/cooking/baking container such as the Crucible. If false, it can be directly baked/melted without smelting/cooking/baking container.</td>
    <td>nugget, ore-graded, lime</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_combustibleprops_info" data-tt-parent="p_combustibleprops" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_combustibleprops_info" data-tt-parent="p_combustibleprops" data-invisible="true"></div></td>
     <td colspan="3">
     <td colspan="4">
This property can be used to define a burning material. '''Plank''' for example can get on fire:
This property can be used to define a burning material. '''Plank''' for example can get on fire:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
Line 1,310: Line 1,321:
     <td>object</td>
     <td>object</td>
     <td>-</td>
     <td>-</td>
     <td>Information about the items nutrients.</td>
     <td>Defines the nutritional qualities of an item.</td>
    <td>fruit, grain, vegetable, redmeat</td>  
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,317: Line 1,329:
     <td>-</td>
     <td>-</td>
     <td>Defines the type of food. It can be '''''fruit''''', '''''vegetable''''', '''''protein''''', '''''grain''''' and '''''dairy'''''.</td>
     <td>Defines the type of food. It can be '''''fruit''''', '''''vegetable''''', '''''protein''''', '''''grain''''' and '''''dairy'''''.</td>
    <td>fruit, grain, vegetable, redmeat</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,323: Line 1,336:
     <td>0</td>
     <td>0</td>
     <td>How much saturation it can restore.</td>
     <td>How much saturation it can restore.</td>
    <td>fruit, grain, vegetable, redmeat</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,329: Line 1,343:
     <td>0</td>
     <td>0</td>
     <td>How much health it can restore.</td>
     <td>How much health it can restore.</td>
    <td>-</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_transprops" data-tt-parent="root">transitionableProps</div></td>
    <td>-</td>
    <td>-</td>
    <td>Can be used to transition an item to another item or block.</td>
    <td>redmeat, hide</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_type" data-tt-parent="p_transprops">type</div></td>
    <td>-</td>
    <td>-</td>
    <td>The type of transition method to utilize.</td>
    <td>redmeat, hide</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_type_cure" data-tt-parent="p_tprops_type">Cure</div></td>
    <td>string</td>
    <td>-</td>
    <td>Will "cure" an item by showing percent progress until cured.</td>
    <td>hide</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_type_perish" data-tt-parent="p_tprops_type">Perish</div></td>
    <td>string</td>
    <td>-</td>
    <td>Will gradually reduce the saturation of a food item once it's fresh period has passed, eventually converting into the product item (usually rot).</td>
    <td>hide</td>
   </tr>
   </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_fresh" data-tt-parent="p_transprops">freshHours</div></td>
    <td>number (hours)</td>
    <td>-</td>
    <td>An optional "fresh" period that must pass before the transition time starts. With food, this is the period of time that saturation is not affected.</td>
    <td>bread, vegetable, redmeat</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_ttime" data-tt-parent="p_transprops">transitionHours</div></td>
    <td>number (hours)</td>
    <td>-</td>
    <td>Number of hours before the item transitions into a different item.</td>
    <td>redmeat, hide</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_stack" data-tt-parent="p_transprops">transitionedStack</div></td>
    <td>object (item or block)</td>
    <td>-</td>
    <td>The item or block that the item will transition into.</td>
    <td>redmeat, hide</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_tprops_ratio" data-tt-parent="p_transprops">transitionRatio</div></td>
    <td>number</td>
    <td>-</td>
    <td>The quantity of the item that will be consumed after the transition period.</td>
    <td>redmeat, hide</td>
  </tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_transition_info" data-tt-parent="p_transprops" data-invisible="true"></div></td>
<td colspan="4">
Here we'll show an example of a custom food item that transitions into rot:
<syntaxhighlight lang="json">
transitionableProps [{
  type: "Perish",
  freshHours: { avg: 240 },
  transitionHours: { avg: 48 },
  transitionedStack { type: "item", code: "game:rot", quantity: 2 },
  transitionRatio: 1
}]
</syntaxhighlight>
We can see that it will take on average 10 days before the food begins to spoil, after which it will degrade over 2 days before turning into 2 rot.
</tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Rendering</b></td>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Rendering</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">textures</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">texture</div></td>
     <td>string</td>
     <td>string</td>
     <td>required</td>
     <td>required</td>
     <td>The texture definitions for the item held in hand or dropped on the ground.</td>
     <td>The texture definition for the item held in hand or dropped on the ground.</td>
    <td>Any Item</td> 
</tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_textures_shape" data-tt-parent="root">textures</div></td>
    <td>string</td>
    <td>-</td>
    <td>Used to define the textures of a shape the item uses, rather than the singular item texture it pulls from. This is useful for items that use a shape and have visually distinct variants that you want to control in the item JSON.</td>
    <td>ingot, redmeat</td> 
   </tr>
   </tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_textures_info" data-tt-parent="p_textures_shape" data-invisible="true"></div></td>
<td colspan="4">
A very simple example is how the ingot item uses the metal variants to change the texture of the shape it uses. Where "metal" is the texture defined in the ingot shape JSON, and is overrode here in the item JSON:
  <syntaxhighlight lang="json">
    textures: {
      "metal": { base: "block/metal/ingot/{metal}" },
    },
  </syntaxhighlight>
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_shape" data-tt-parent="root">shape</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_shape" data-tt-parent="root">shape</div></td>
     <td>object</td>
     <td>object</td>
     <td>-</td>
     <td>-</td>
     <td>The items shape. Empty for automatic shape based on the texture.</td>
     <td>The items shape. If left empty the item will instead use the texture assigned to it and turn it into a shape by default.</td>
    <td>flint, stone</td>
</tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shape_vox" data-tt-parent="p_shape">voxelizeTexture</div></td>
    <td>boolean</td>
    <td>-</td>
    <td>Tells an item to render it's texture as a shape rather than utilizing the assigned texture</td>
    <td>redmeat (vintage)</td>
   </tr>
   </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_shape_alt" data-tt-parent="p_shape">alternatives</div></td>
    <td>array of shapes</td>
    <td>-</td>
    <td>Can be used to give an item alternative shapes based off of different states.</td>
    <td>bow</td>
</tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_shapealt_info" data-tt-parent="p_shape" data-invisible="true"></div></td>
<td colspan="4">
<syntaxhighlight lang="json">
shape: {
  base: "item/tool/bow/{type}",
  alternates: [
    { base: "item/tool/bow/{type}-charge1" },
    { base: "item/tool/bow/{type}-charge2" },
    { base: "item/tool/bow/{type}-charge3" } 
  ]
},
</syntaxhighlight>
In this example taken from the bow we can see that it will use alternative shapes when the bow is in different "charged" states.
</tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_shapeinventory" data-tt-parent="root">shapeinventory</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_shapeinventory" data-tt-parent="root">shapeinventory</div></td>
219

edits