Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
Line 2: Line 2:
== Overview ==
== Overview ==
A complete list of all available properties
A complete list of all available properties
Definitions:
'''Key''' - The name of the property, which should be used as it appears in the column.
'''Value''' - A component of a property.
'''Array''' - A list of objects or values that can be referenced in code.
'''String''' - A sequence of characters that can be used as an identifier in code. Essentially a word that can be referenced and assigned to something. Generally does not use numbers.
'''Boolean''' - A true or false value, essentially "on" or "off".
'''Int''' - An integer, or whole number. Cannot use decimal values.
'''Float''' - A decimal, specifically one that does not exceed more than 1 significiant digit
'''Object''' - This is a bit more complex, but essentially objects are the items, blocks and entities that can be interacted with. In most cases, when an "object" type appears it means you must use a specific item variant code, which follows the "itemcode-variant_1-variant_2-variant_n" style of naming.


<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'>
<table id="treeviewtable" class="table table-bordered tt-table" style='table-layout: fixed'>
Line 48: Line 67:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_variantgroups" data-tt-parent="root">variantgroups</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_variantgroups" data-tt-parent="root">variantgroups</div></td>
     <td>array of object</td>
     <td>array of objects</td>
     <td>-</td>
     <td>-</td>
     <td>Allows you define multiple variants of the same item.</td>
     <td>Allows you define multiple variants of the same item.</td>
Line 213: Line 232:
   <tr>
   <tr>
   <td scope="row"><div class="tt" data-tt-id="p_enabled" data-tt-parent="root">allowedVariants</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_enabled" data-tt-parent="root">allowedVariants</div></td>
   <td>array</td>
   <td>array of objects</td>
   <td>-</td>
   <td>-</td>
   <td>Used to trim unnecessary items generated by combined variants. </td>
   <td>Used to trim unnecessary items generated by combined variants. </td>
Line 220: Line 239:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_enabled" data-tt-parent="root">skipVariants</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_enabled" data-tt-parent="root">skipVariants</div></td>
   <td>array</td>
   <td>array of object</td>
   <td>-</td>
   <td>-</td>
   <td>Similar to allowedVariants, but instead skips the creation of listed variants rather than assigning which are allowed. </td>
   <td>Similar to allowedVariants, but instead skips the creation of listed variants rather than assigning which are allowed. </td>
Line 372: Line 391:
  <tr>
  <tr>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_list" data-tt-parent="root">attributes</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_attributes_list" data-tt-parent="root">attributes</div></td>
     <td>key: string, value: object</td>
     <td>-</td>
     <td>-</td>
     <td>-</td>
     <td>Custom Attributes associated with this item.</td>
     <td>Custom Attributes associated with this item.</td>
Line 500: Line 519:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_liquidcontain" data-tt-parent="p_alist_waterprops">containable</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_liquidcontain" data-tt-parent="p_alist_waterprops">containable</div></td>
   <td>true</td>
   <td>boolean</td>
   <td>-</td>
   <td>-</td>
   <td>IF true, the liquid can be placed into liquid containers, such as barrels and buckets.</td>
   <td>If true, the liquid can be placed into liquid containers, such as barrels and buckets.</td>
   <td>waterportion, limewaterportion</td>
   <td>waterportion, limewaterportion</td>
</tr>
</tr>
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_iperlitre" data-tt-parent="p_alist_waterprops">itemsPerLitre</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_iperlitre" data-tt-parent="p_alist_waterprops">itemsPerLitre</div></td>
   <td>number</td>
   <td>number (int)</td>
   <td>-</td>
   <td>-</td>
   <td>The number of itemstack items required to make a litre of liquid. Generally this value is 1:1, but concentrated items like honey can be 4:1.</td>
   <td>The number of itemstack items required to make a litre of liquid. Generally this value is 1:1, but concentrated items like honey can be 4:1.</td>
Line 563: Line 582:
<tr>
<tr>
   <td scope="row"><div class="tt" data-tt-id="p_alist_spillstack" data-tt-parent="p_alist_whenspill">stack</div></td>
   <td scope="row"><div class="tt" data-tt-id="p_alist_spillstack" data-tt-parent="p_alist_whenspill">stack</div></td>
   <td>string</td>
   <td>Object</td>
   <td>-</td>
   <td>-</td>
   <td>The block or item dropped when spilled. if the "PlaceBlock" action is chosen a block is placed, if "DropContents" is used an item is generated.</td>
   <td>The block or item dropped when spilled. if the "PlaceBlock" action is chosen a block is placed, if "DropContents" is used an item is generated.</td>
Line 575: Line 594:
   <td>waterportion, limewater</td>
   <td>waterportion, limewater</td>
</tr>
</tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_attributes_info" data-tt-parent="p_alist_waterprops" data-invisible="true"></div></td>
<td colspan="4">
We'll look at an example of how this property is utilized by water item:
<syntaxhighlight lang="json">
waterTightContainerProps: {
  containable: true,
  itemsPerLitre: 1,
  texture: { base: "block/liquid/waterportion" },
  tintIndex: 2,
  whenSpilled: {
    action: "PlaceBlock",
    stack: { type: "block", code: "water-still-3" },
    stackByFillLevel: {
      "10": { type: "block", code: "water-still-7" }
    }
  }
}
</syntaxhighlight>
Most is self explanatory, but we can see that it has a some unique features, such as allowing a player to generate a water block when the "fill level" of the container used to spill the fluid. We can also see that the texture for it has a tintIndex of 2, which heightens the blue coloration of the water texture while in a bucket.
</tr>




219

edits