Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
(13 intermediate revisions by 3 users not shown)
Line 4: Line 4:


<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'>
   <tr style='background-color: gray;'>
   <tr>
     <th width='300' align='left'>Property</th>
     <th width='300' align='left'>Property</th>
     <th width='200' align='left'>Type</th>
     <th width='200' align='left'>Type</th>
Line 17: Line 17:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Core (no byType available)</b></td>
     <td colspan="4" class="propHeader"><b>Core (no byType available)</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 89: Line 89:
----
----


Futhermore there are two ways of combining groups together. So far we covered the default combination mode, which is <code>multiplicative</code> (the total count of variants is the product of all states).
Furthermore there are two ways of combining groups together. So far we covered the default combination mode, which is <code>multiplicative</code> (the total count of variants is the product of all states).


Let's take a look at a different example (flowerpot), which uses the <code>additive</code> combination mode:
Let's take a look at a different example (flowerpot), which uses the <code>additive</code> combination mode:
Line 173: Line 173:
"*-south-*-closed-right": 180
"*-south-*-closed-right": 180
}
}
},
</syntaxhighlight>
Since Vintagestory v1.8 it is also possible to use the variantgroup as a placeholder:
<syntaxhighlight lang="json">
variantgroups: [
{ code: "type", states: ["normal", "bamboo"] },
],
textures: {
horizontals: { base: "block/hay/{type}-side" },
verticals: { base: "block/hay/{type}-top" },
},
},
</syntaxhighlight>
</syntaxhighlight>
Line 178: Line 189:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Specific</b></td>
     <td colspan="4" class="propHeader"><b>Specific</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 208: Line 219:
     <td>array of object</td>
     <td>array of object</td>
     <td>-</td>
     <td>-</td>
     <td>A behavior adds custom abilities such as falling block..</td>
     <td>A behavior adds custom abilities such as falling block.</td>
   </tr>
   </tr>
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_behaviors_info" data-tt-parent="p_behaviors" data-invisible="true"></div></td>
     <td scope="row"><div class="tt" data-tt-id="p_behaviors_info" data-tt-parent="p_behaviors" data-invisible="true"></div></td>
     <td colspan="3">
     <td colspan="3">
Here is an overview of all exisiting behaviors, if you want to create your own custom behavior you can read [[Adding Block Behavior]].
Here is an overview of most exisiting behaviors, if you want to create your own custom behavior you can read [[Adding Block Behavior]].
To see all of the current behaviors in the game see [[Json:block:behaviors|All Block Behaviors]]
{{:json:block:behavior}}
{{:json:block:behavior}}
</td>
</td>
Line 543: Line 555:
     <td>0 ... 255</td>
     <td>0 ... 255</td>
     <td>0</td>
     <td>0</td>
     <td>Basic glow level for all the blocks model elements.</td>
     <td>Causes the block to visually glow if Bloom is enabled. Basic glow level for all the blocks model elements.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 676: Line 688:
     <td>'''lastdrop'''</td>
     <td>'''lastdrop'''</td>
<td>false</td>
<td>false</td>
<td>If true and the quantity dropped is >=1 any subsequent drop will be ignored.</td>
<td>If true and the quantity dropped is >=1 any subsequent drop in the list will be ignored.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 733: Line 745:
'''''var''''': How much the drop rate can vary. Meaning the drop rate can be <code>avg - var</code> at minimum and <code>age + var</code> at maximum.
'''''var''''': How much the drop rate can vary. Meaning the drop rate can be <code>avg - var</code> at minimum and <code>age + var</code> at maximum.


Futhermore you can also switch between different distribution modes using the '''''dist''''' property.
Furthermore you can also switch between different distribution modes using the '''''dist''''' property.


<table class="wikitable mw-collapsible mw-collapsed">
<table class="wikitable mw-collapsible mw-collapsed">
Line 911: Line 923:
   </tr>
   </tr>
   <tr>
   <tr>
     <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td>
     <td colspan="4" class="propHeader"><b>Common</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,002: Line 1,014:
     <td>key: string, value: object</td>
     <td>key: string, value: object</td>
     <td>-</td>
     <td>-</td>
     <td>Custom Attributes that's always assiociated with this item.</td>
     <td>Custom Attributes associated with this block.</td>
   </tr>
   </tr>
   <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="3">
Extra attributes added to a block. Those are final and cannot be modified. It's a good way to keep things oragnized and and modifiable. The '''oreblastingbomb''' for example has attributes, which define its radius and type. These can be used by behaviors and blockentities:
Extra attributes added to a 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:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
     attributes: {
     attributes: {
Line 1,026: Line 1,038:
     <td>integer</td>
     <td>integer</td>
     <td>-</td>
     <td>-</td>
     <td>The temperature at which it burns.</td>
     <td>The temperature at which it burns in degrees Celsius.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,032: Line 1,044:
     <td>decimal number</td>
     <td>decimal number</td>
     <td>-</td>
     <td>-</td>
     <td>For how long it burns.</td>
     <td>For how long it burns in seconds.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,038: Line 1,050:
     <td>integer</td>
     <td>integer</td>
     <td>500</td>
     <td>500</td>
     <td>How many degrees celsius it can resists before it ignites.</td>
     <td>How many degrees celsius it can resists before it ignites (not implemented yet).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,044: Line 1,056:
     <td>integer</td>
     <td>integer</td>
     <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 SmeltedStack is set.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,074: Line 1,086:
     <td>boolean</td>
     <td>boolean</td>
     <td>true</td>
     <td>true</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 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>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,087: Line 1,099:
</syntaxhighlight>
</syntaxhighlight>


Futhermore it can be used to define smelting processes. An example would be an '''ingotmold''' which turns into an ingotmold-burned:
Furthermore it can be used to define smelting processes. An example would be an '''ingotmold''' which turns into an ingotmold-burned:
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
     combustiblePropsByType: {
     combustiblePropsByType: {
Line 1,126: Line 1,138:
   </tr>
   </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" class="propHeader"><b>Rendering</b></td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,132: Line 1,144:
     <td>key: string, value: object</td>
     <td>key: string, value: object</td>
     <td></td>
     <td></td>
     <td>The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand.</td>
     <td>The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand. Within a mod, to refer to a texture from the base game, prefix the path with "game:" (i.e. base: "game:path/to/texture") </td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,346: Line 1,358:
     <td></td>
     <td></td>
     <td>2</td>
     <td>2</td>
     <td>Culls all faces that are adjacent to opaque faces and faces adjacent to blocks of the same id.</td>
     <td>Culls all faces that are adjacent to opaque faces and faces adjacent to blocks of the same id (Example usage: Ice blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,352: Line 1,364:
     <td></td>
     <td></td>
     <td>3</td>
     <td>3</td>
     <td>Culls all faces that are adjacent to opaque faces and the bottom, east or south faces adjacent to blocks of the same id. This causes to still leave one single face inbetween instead of 2, eliminating any z-fighting.</td>
     <td>Culls all faces that are adjacent to opaque faces and the bottom, east or south faces adjacent to blocks of the same id. This causes to still leave one single face in between instead of 2, eliminating any z-fighting.</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,358: Line 1,370:
     <td></td>
     <td></td>
     <td>4</td>
     <td>4</td>
     <td>Same as Merge but checks for equal material.</td>
     <td>Same as Merge but checks for equal material (Example usage: Plain glass and all colored glass blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
Line 1,364: Line 1,376:
     <td></td>
     <td></td>
     <td>5</td>
     <td>5</td>
     <td>Same as Collapse but checks for equal material.</td>
     <td>Same as Collapse but checks for equal material (Example usage: All leaves blocks).</td>
   </tr>
   </tr>
   <tr>
   <tr>
42

edits