Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
(4 intermediate revisions by the same user not shown)
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 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>
Line 733: Line 744:
'''''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 1,002: Line 1,013:
     <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,087: Line 1,098:
</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: {
Confirmedusers, editor, Administrators
886

edits