Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
Line 1,595: Line 1,595:
     </syntaxhighlight>
     </syntaxhighlight>
  </tr>
  </tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_quantityslots" data-tt-parent="p_attributes_contain">quantitySlots</div></td>
    <td>number</td>
    <td>-</td>
    <td>The number of slots a generic container has.</td>
    <td>chest, storagevessel</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_requiredunits" data-tt-parent="p_attributes_contain">requiredUnits</div></td>
    <td>number</td>
    <td>-</td>
    <td>The number of units required to fill a tool mold with molten metal.</td>
    <td>toolmold</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_retrieveonly" data-tt-parent="p_attributes_contain">retrieveOnly</div></td>
    <td>boolean</td>
    <td>-</td>
    <td>If true, makes it so that a container can only be taken from and cannot be used to store new items.</td>
    <td>lootvessel</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_servingcapacity" data-tt-parent="p_attributes_contain">servingCapacity</div></td>
    <td>number</td>
    <td>-</td>
    <td>The number of servings of a meal a block can hold.</td>
    <td>crock, bowl</td>
</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 block to be placed on a shelf.</td>
    <td>crystal-small, seashell</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_sitheight" data-tt-parent="p_attributes_contain">sitHeight</div></td>
    <td>number (decimal)</td>
    <td>-</td>
    <td>Used by flower pots to determine how high the incorporated block should be rendered.</td>
    <td>flowerpot, planter</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_spoilmultiplier" data-tt-parent="p_attributes_contain">spoilSpeedMulByFoodCat</div></td>
    <td>-</td>
    <td>-</td>
    <td>Used to make food spoil slower or faster when stored in a container.</td>
    <td>storagevessel</td>
</tr>
<tr>
<td scope="row"><div class="tt" data-tt-id="p_spoilspeed_info" data-tt-parent="p_alist_spoilmultiplier" data-invisible="true"></div></td>
<td colspan="4">
The clay storage vessel is a good example of this:
<syntaxhighlight lang="json">
spoilSpeedMulByFoodCat: {
  "normal": {
    "vegetable": 0.75,
    "grain": 0.5
  }
},
</syntaxhighlight>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_storagetype" data-tt-parent="p_attributes_contain">storageType</div></td>
    <td>Number (Storage Flag)</td>
    <td>-</td>
    <td>The storage flag of the container, which can limit what types of items or blocks can be stored within it.</td>
    <td>storagevessel</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_storagetype" data-tt-parent="p_attributes_contain">textureMapping</div></td>
    <td>-</td>
    <td>-</td>
    <td>A more complex method of texturing block shapes with multiple content combinations. Used primarily with the pot to texture the food contents.</td>
    <td>pot</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_types" data-tt-parent="p_attributes_contain">types</div></td>
    <td>-</td>
    <td>-</td>
    <td>A secondary method of variant categorization used by containers to help with assigning attributes.</td>
    <td>chest</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_varaintbygroup" data-tt-parent="p_attributes_contain">variantByGroup</div></td>
    <td>-</td>
    <td>-</td>
    <td>Used by generic containers to group types by a specific variant. "side" is used since it is a common variant of all the types.</td>
    <td>chest</td>
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_varaintbygroupinv" data-tt-parent="p_attributes_contain">variantByGroupInventory</div></td>
    <td>-</td>
    <td>-</td>
    <td>A subtype inventory name that can be assigned to types (usually this is "null").</td>
    <td>chest</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 block, generally determining how it is stored and used with a bucket. '''Keep in mind this is not generally used for blocks, as most liquids that use this property are items, even if they come from a source block'''.</td>
  <td>water</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>boolean</td>
  <td>-</td>
  <td>If true, the liquid can be placed into liquid containers, such as barrels and buckets.</td>
  <td>water</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 (int)</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>water</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>integer</td>
    <td>0</td>
    <td>Tints the color of the item if it's ever drawn as a block: '''''0''''' for no tint, '''''1''''' for plant climate tint, '''''2''''' for water climate tint.</td>
    <td>-</td>
  <td>waterportion, limewater</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_whenfill" data-tt-parent="p_alist_waterprops">whenFilled</div></td>
  <td>Item or Block Code</td>
  <td>-</td>
  <td>Determines what is stored in a liquid container when interacted with.</td>
  <td>water</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_whenspill" 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>
  <td scope="row"><div class="tt" data-tt-id="p_alist_spillact" data-tt-parent="p_alist_whenspill">action</div></td>
  <td>string</td>
  <td>-</td>
  <td>Code identifier that determines what happens when the liquid is spilled from a container.</td>
  <td>waterportion, limewater</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_spillblock" data-tt-parent="p_alist_spillact">PlaceBlock</div></td>
  <td>-</td>
  <td>-</td>
  <td>Places a block at the spilled location.</td>
  <td>waterportion</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_spillitem" data-tt-parent="p_alist_spillact">DropContents</div></td>
  <td>-</td>
  <td>-</td>
  <td>Drops an item at the location. If the item is a liquid it will disappear immediately with a "splash" particle effect.</td>
  <td>limeportion</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_spillstack" data-tt-parent="p_alist_whenspill">stack</div></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>waterportion, limewater</td>
</tr>
<tr>
  <td scope="row"><div class="tt" data-tt-id="p_alist_sfilllevel" data-tt-parent="p_alist_whenspill">stackByFillLevel</div></td>
  <td>-</td>
  <td>-</td>
  <td>Allows for different blocks or items to be placed based on the level of the liquid in the container.</td>
  <td>waterportion, limewater</td>
</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 block:


<syntaxhighlight lang="json">
waterTightContainerProps: {
  containable: true,
  itemsPerLitre: 1,
  whenFilled: { stack: { type: "item", code: "waterportion" } }
}
</syntaxhighlight>
As we can see, most of the watertight properties are not used by the block, that's because most of them are used by the item equivalent "waterportion".
</tr>


<tr>
<tr>
Line 1,773: Line 1,977:
     <td>Gives some blocks additional rotation properties when placed (currently "22.5degnot45deg" and "22.tdeg" are the only two options).</td>
     <td>Gives some blocks additional rotation properties when placed (currently "22.5degnot45deg" and "22.tdeg" are the only two options).</td>
     <td>chest</td>  
     <td>chest</td>  
</tr>
<tr>
    <td scope="row"><div class="tt" data-tt-id="p_alist_sleepefficiency" data-tt-parent="p_attributes_misc">sleepEfficiency</div></td>
    <td>number (decimal)</td>
    <td>-</td>
    <td>Determines how long a player can sleep in a bed, based off a ratio of 12 hours. (ratio = #maxhours/12).</td>
    <td>-</td>
  </tr>
  </tr>
  <tr>
  <tr>
219

edits