Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
no edit summary
No edit summary
No edit summary
Line 268: Line 268:
     <td colspan="3">
     <td colspan="3">
All none solid blocks can't be covered by snow unless it's defined different:
All none solid blocks can't be covered by snow unless it's defined different:
*Leaves (also branchy): true,
*Leaves (also branchy): '''true''',
*Water with particles, Lakeice: false
*Water with particles, Lakeice: '''false'''
</td>
</td>
   </tr>
   </tr>
Line 428: Line 428:
</td>
</td>
   </tr>
   </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_glowlevel" data-tt-parent="root">GlowLevel</div></td>
    <td>0 ... 255</td>
    <td>0</td>
    <td>Basic glow level for all the blocks model elements.</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_glowlevel_info" data-tt-parent="p_glowlevel" data-invisible="true"></div></td>
    <td colspan="3">
<table class="wikitable">
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Blocks</th>
    <th style="background-color: grey;">Value</th>
  </tr>
  <tr>
    <td>''Glacierice''</td>
<td>'''8'''</td>
  </tr>
  <tr>
    <td>''Paperlantern''</td>
<td>'''32'''</td>
  </tr>
  <tr>
    <td>''Ember''</td>
<td>'''48'''</td>
  </tr>
  <tr>
    <td>''Fire'', ''Firepit'', ''Oillamp'', ''Torch''</td>
<td>'''64'''</td>
  </tr>
  <tr>
    <td>''Lava''</td>
<td>'''128'''</td>
  </tr>
</table>
</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_lightabsorption" data-tt-parent="root">LightAbsorption</div></td>
    <td>0 ... 32</td>
    <td>0</td>
    <td>For light blocking blocks. Any value above 32 will completely block all light.</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_walkspeedmultiplier" data-tt-parent="root">WalkspeedMultiplier</div></td>
    <td>decimal number</td>
    <td>1</td>
    <td>Percentage walk-speed when standing on or inside this block.</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_walkspeedmultiplier_info" data-tt-parent="p_walkspeedmultiplier" data-invisible="true"></div></td>
    <td colspan="3">
<table class="wikitable">
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Blocks</th>
    <th style="background-color: grey;">Value</th>
  </tr>
  <tr>
    <td>''Spiderweb''</td>
<td>'''0.25'''</td>
  </tr>
  <tr>
    <td>''Stonepath''</td>
<td>'''1.15'''</td>
  </tr>
</table>
</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_dragmultiplier" data-tt-parent="root">DragMultiplier</div></td>
    <td>decimal number</td>
    <td>1</td>
    <td>Drag multiplier applied to entities standing on it (slipperiness factor).</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_dragmultiplier_info" data-tt-parent="p_dragmultiplier" data-invisible="true"></div></td>
    <td colspan="3">
<table class="wikitable">
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Blocks</th>
    <th style="background-color: grey;">Value</th>
  </tr>
  <tr>
    <td>''Glacierice'', ''Lakeice''</td>
<td>'''0.02'''</td>
  </tr>
</table>
</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_drops" data-tt-parent="root">Drops</div></td>
    <td>array of object</td>
    <td>-</td>
    <td>The items that should drop from breaking this block.</td>
  </tr>
  <tr>
    <td scope="row"><div class="tt" data-tt-id="p_drops_info" data-tt-parent="p_drops" data-invisible="true"></div></td>
    <td colspan="3">
'''Drop itself'''
If this property does not exist the block will drop itself.
----
'''No drop'''
A '''firepit''' for example doesn't drop anything. You can do so if you specify an empty array:
<syntaxhighlight lang="json">
drops: [],
</syntaxhighlight>
----
'''Special drop'''
You can also specify a special item/ block. Therefore you need to define an '''ItemStack''', with the given properties:
<table class="wikitable">
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Property</th>
    <th style="background-color: grey;">Default</th>
<th style="background-color: grey;">Explanation</th>
  </tr>
  <tr>
    <td>'''type'''</td>
<td>''block''</td>
<td>Can either be '''''block''''' or '''''item'''''.</td>
  </tr>
  <tr>
    <td>'''code''' (required)</td>
<td>-</td>
<td>The complete code (can also include domain) of the item or block.</td>
  </tr>
  <tr>
    <td>'''lastdrop'''</td>
<td>false</td>
<td>If true and the quantity dropped is >=1 any subsequent drop will be ignored.</td>
  </tr>
  <tr>
    <td>'''attributes'''</td>
<td>-</td>
<td>Tree Attributes that will be attached to the resulting itemstack.</td>
  </tr>
  <tr>
    <td>'''tool'''</td>
<td>-</td>
<td>If specified then given tool is required to break this block.</td>
  </tr>
  <tr>
    <td>'''quantity'''</td>
<td>- (one)</td>
<td>Determines the quantity of items which will be dropped.</td>
  </tr>
</table>
For example, the drop of a '''charcoalpile''' looks like this:
<syntaxhighlight lang="json">
drops: [
{ type: "item", code: "charcoal" }
],
</syntaxhighlight>
'''Tallgrass''' will only drop something if it's mined by a knife:
<syntaxhighlight lang="json">
drops: [
{ type: "item", code: "drygrass", tool: "knife"  },
],
</syntaxhighlight>
----
'''Chance drop'''
quantity
<table class="wikitable">
  <tr style="background-color: grey;">
    <th style="background-color: grey;">Name</th>
<th style="background-color: grey;">Explanation</th>
  </tr>
  <tr>
    <td>'''uniform'''</td>
<td>''Select completely random numbers within avg-var until avg+var.''</td>
  </tr>
  <tr>
    <td>'''triangle'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a triangle curve.''</td>
  </tr>
  <tr>
    <td>'''gaussian'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''narrowgaussian'''</td>
<td>''Select random numbers with numbers near avg being the most commonly selected ones, following a narrow gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''inversegaussian'''</td>
<td>''Select random numbers with numbers near avg being the least commonly selected ones, following an upside down gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''narrowinversegaussian'''</td>
<td>''Select random numbers with numbers near avg being the least commonly selected ones, following an upside down gaussian curve.''</td>
  </tr>
  <tr>
    <td>'''invexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are preferred.''</td>
  </tr>
  <tr>
    <td>'''stronginvexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are strongly preferred.''</td>
  </tr>
  <tr>
    <td>'''strongerinvexp'''</td>
<td>''Select numbers in the form of avg + var, wheras low value of var are very strongly preferred.''</td>
  </tr>
<tr>
    <td>'''dirac'''</td>
<td>''Select completely random numbers within avg-var until avg+var only ONCE and then always 0.''</td>
  </tr>
</table>
   
<syntaxhighlight lang="json">
drops: [
{
type: "item",
code: "stone-{rock}",
quantity: { avg: 2.5, var: 0.5 }
},
]
</syntaxhighlight>
https://en.wikipedia.org/wiki/Gaussian_function#/media/File:Normal_Distribution_PDF.svg
----
'''Multiple Drops'''
Of course you can also define multiple drops at once. '''Sapling''' can drop a sapling and a stick:
<syntaxhighlight lang="json">
drops: [
{
type: "block",
code: "sapling-{wood}",
quantity: { avg: 0.02, var: 0 },
},
{
type: "item",
code: "stick",
quantity: { avg: 0.02, var: 0 },
}
],
</syntaxhighlight>
----
'''Last Drop'''
dropsByType: {
"ore-quartz-*": [
{ type: "item", code: "clearquartz",  quantity: { avg: 0.2, var: 0 }, lastDrop: true },
{ type: "item", code: "ore-{ore}",  quantity: { avg: 1.25, var: 0 }  }
],
"*": [
{ type: "item", code: "ore-{ore}",  quantity: { avg: 1.25, var: 0 }  }
],
}
</td>
  </tr>
 
 
    
    
  <tr>
    <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;'><b>Common</b></td>
  </tr>
    
    
    
    
Confirmedusers, editor, Administrators
886

edits