Modding:Item Json Properties: Difference between revisions

From Vintage Story Wiki
Line 399: Line 399:
Attributes that change how items interact with containers.
Attributes that change how items interact with containers.
</tr>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_barrelmove" data-tt-parent="p_attributes_contain">barrelMovetoLiquidSlot</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If set to true, converts an item placed into a barrel to a "liquid" state that can be used for barrel recipes (EX: how salt is used to cure meat).</td>
  <td>salt</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_crockable" data-tt-parent="p_attributes_contain">crockable</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If set to true, can be placed into a crock from another container (Keep in mind that doing so also turns the item into a meal, which cannot be undone).</td>
  <td>pickledvegetable</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_displaycasable" data-tt-parent="p_attributes_contain">displaycaseable</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If set to true, allows an item to be placed into a display case.</td>
  <td>ingot, ore-graded, ore-ungraded, stone</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_forgable" data-tt-parent="p_attributes_contain">forgable</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>A bit of a misnomer, this indicates that an item can be placed into and heated in a forge, not that it can or can't be forged on an anvil.</td>
  <td>ironbloom</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_containtext" data-tt-parent="p_attributes_contain">inContainerTexture</div></td>
  <td>Path to texture</td>
  <td>-</td>
  <td>Pathway to the texture shown when an item is placed into a barrel. This can include a liquid or solids.</td>
  <td>waterportion, salt</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_infpprops" data-tt-parent="p_attributes_contain">inFirePitProps</div></td>
  <td>-</td>
  <td>-</td>
  <td>Gives an item additional rendering properties when placed in a fire pit.</td>
  <td>redmeat, poultry</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_fptrans" data-tt-parent="p_alist_infpprops">transform</div></td>
  <td>-</td>
  <td>-</td>
  <td>If the model type shows the item, it can be transformed using this property.</td>
  <td>redmeat, poultry</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_fpmodel" data-tt-parent="p_alist_infpprops">useFirepitModel</div></td>
  <td>-</td>
  <td>-</td>
  <td>Tell the firepit which model to use when this item is placed into it.</td>
  <td>redmeat, poultry</td>
</tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_firepittrans_ex" data-tt-parent="p_alist_infpprops" data-invisible="true"></div></td>
<td colspan="4">
Here's an example of how the firepit transformation is used by the different meat items:
<syntaxhighlight lang="json">
inFirePitProps: {
  transform: {
    scale: 0.85,
    origin: { x: 0.5, y: 0.0625, z: 0.5 },
    translation: { x: -0.03125, y: 0.0625, z: 0.046875 },
    rotation: { x: 0, y: 0, z: 90 }
  },
  useFirepitModel: "Spit"
        },
</syntaxhighlight>
If you're familiar with the other transformation code, this is nothing unusual and works on the same principles by changing the scale, position and rotation of the model with respect to the origin of rotation.
At the moment <code>spit</code> is the only model used with single food items. The other option <code>wide</code> is used with the cooking pot.
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_shelvable" data-tt-parent="p_attributes_contain">shelvable</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If true, allows the item to be placed on shelves.</td>
  <td>redmeat, stone</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_rackable" data-tt-parent="p_attributes_contain">rackable</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If true, allows the item to be placed on a tool rack. To look right the item also requires additional transformations using the toolrackTransform property (see rendering section).</td>
  <td>pickaxe, scythe, sword</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_waterprops" data-tt-parent="p_attributes_contain">waterTightContainerProps</div></td>
  <td>-</td>
  <td>-</td>
  <td>This contains all the liquid properties of an item, generally determining how it is stored and used with a bucket.</td>
  <td>waterportion, limewaterportion</td>
</tr>
<tr>
  <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>-</td>
  <td>IF true, the liquid can be placed into liquid containers, such as barrels and buckets.</td>
  <td>waterportion, limewaterportion</td>
</tr>
<tr>
  <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>-</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>waterportion, honeyportion</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_liqtex" data-tt-parent="p_alist_waterprops">texture</div></td>
  <td>Path to Texture</td>
  <td>-</td>
  <td>A "block" texture given to a liquid when it's rendered in containers or other items.</td>
  <td>waterportion, honeyportion</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_spill" data-tt-parent="p_alist_waterprops">allowSpill</div></td>
  <td>boolean</td>
  <td>-</td>
  <td>If true, allows the player to use the Ctr + Right Click function to "spill" the liquid from a container. The whenSpilled property determines what happens if this is true.</td>
  <td>waterportion, limewater</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_tindex" data-tt-parent="p_alist_waterprops">tintIndex</div></td>
  <td>number (0,1 or 2)</td>
  <td>-</td>
  <td>An optional liquid property that tints the color of a liquid when in a container. Available options are 0(red), 1(green) and 2(blue).</td>
  <td>waterportion, limewater</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_tindex" data-tt-parent="p_alist_waterprops">whenSpilled</div></td>
  <td>-</td>
  <td>-</td>
  <td>Determines what happens when the "spill" interaction is used. Only works if the allowSpill property is set to true.</td>
  <td>waterportion, limewater</td>
</tr>


<tr>
<tr>
219

edits