Modding:Block Json Properties: Difference between revisions
From Vintage Story Wiki
CreativeMD (talk | contribs) No edit summary |
CreativeMD (talk | contribs) No edit summary |
||
Line 1: | Line 1: | ||
== Overview == | == Overview == | ||
A complete list of all available properties: | A complete list of all available properties: | ||
<table id="treeviewtable" class="table table-bordered tt-table"> | <table id="treeviewtable" class="table table-bordered tt-table"> | ||
Line 15: | Line 14: | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
</tr> | |||
<tr> | |||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;"><b>Common</b></td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 33: | Line 35: | ||
<td>true</td> | <td>true</td> | ||
<td>If the block will be added to game or not.</td> | <td>If the block will be added to game or not.</td> | ||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_class" data-tt-parent="root">class</div></td> | |||
<td>string</td> | |||
<td>block</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_behaviors" data-tt-parent="root">behaviors</div></td> | |||
<td>array of strings</td> | |||
<td>empty</td> | |||
<td></td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_variantgroups" data-tt-parent="root">variantgroups</div></td> | |||
<td>arrays</td> | |||
<td></td> | |||
<td>Allows you define multiple variants of the same block.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_blockmaterial" data-tt-parent="root">blockmaterial</div></td> | |||
<td>string</td> | |||
<td></td> | |||
<td>The blocks material, check [[Block Materials]] for a full list. Amongst others, it will determine how quickly a specific tool can mine it.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_resistance" data-tt-parent="root">resistance</div></td> | |||
<td></td> | |||
<td></td> | |||
<td>How many seconds it takes to break the block (excluding speed mining bonus). Decimal numbers are allowed.</td> | |||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_creativeinventory" data-tt-parent="root">creativeinventory</div></td> | |||
<td>arrays</td> | |||
<td></td> | |||
<td>In which creative inventory tabs the block should be visible in.</td> | |||
</tr> | |||
<tr> | |||
<td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;"><b>Rendering</b></td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 71: | Line 112: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id=" | <td scope="row"><div class="tt" data-tt-id="p_shape" data-tt-parent="root">shape</div></td> | ||
<td> | <td>object</td> | ||
<td></td> | <td></td> | ||
<td> | <td>For the json drawtype, the shape definition of the block as shown in the world, dropped on the ground or held in hand.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id=" | <td scope="row"><div class="tt" data-tt-id="p_base" data-tt-parent="p_shape">base</div></td> | ||
<td> | <td></td> | ||
<td></td> | <td></td> | ||
<td> | <td>The path to the shape json file, the base dir is ''assets/shapes/''.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 90: | Line 131: | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id="p_invbase" data-tt-parent="p_shapeinventory">base</div></td> | <td scope="row"><div class="tt" data-tt-id="p_invbase" data-tt-parent="p_shapeinventory">base</div></td> | ||
<td></td> | <td></td> | ||
<td></td> | <td></td> | ||
Line 119: | Line 148: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td scope="row"><div class="tt" data-tt-id=" | <td scope="row"><div class="tt" data-tt-id="p_drawtype" data-tt-parent="root" hide="children">drawtype</div></td> | ||
<td>enum</td> | <td>enum</td> | ||
<td>cube</td> | <td>cube</td> | ||
Line 176: | Line 199: | ||
<td></td> | <td></td> | ||
<td>7</td> | <td>7</td> | ||
<td></td> | <td>Will draw a json model.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 182: | Line 205: | ||
<td></td> | <td></td> | ||
<td>8</td> | <td>8</td> | ||
<td></td> | <td>Nothing will be drawn.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 188: | Line 211: | ||
<td></td> | <td></td> | ||
<td>9</td> | <td>9</td> | ||
<td></td> | <td>Draws an ordinary cube.</td> | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 231: | Line 254: | ||
<td></td> | <td></td> | ||
<td>When defining multiple block variants, use this property to selectively choose the textures of a variant.</td> | <td>When defining multiple block variants, use this property to selectively choose the textures of a variant.</td> | ||
</tr> | |||
<tr> | |||
<td scope="row"><div class="tt" data-tt-id="p_SideOpaque" data-tt-parent="root">SideOpaque</div></td> | |||
<td>directional object</td> | |||
<td></td> | |||
<td></td> | |||
</tr> | </tr> | ||
<tr> | <tr> | ||
Line 239: | Line 268: | ||
</tr> | </tr> | ||
<tr> | <tr> | ||
<td | <td colspan="4" style='font-size: 14pt; border-bottom: 2pt solid black; padding-left: 100px;"><b>Sound</b></td> | ||
</tr> | </tr> | ||
<tr> | <tr> |
Revision as of 14:43, 13 January 2017
Overview
A complete list of all available properties:
Property | Type | Default | Usage |
---|---|---|---|
json |
|||
Common | |||
code |
string | - | A unique identifier for the block. |
maxstacksize |
number | 64 | Determines the maximum amount you can stack the block in one slot. |
enabled |
boolean | true | If the block will be added to game or not. |
class |
string | block | |
behaviors |
array of strings | empty | |
variantgroups |
arrays | Allows you define multiple variants of the same block. | |
blockmaterial |
string | The blocks material, check Block Materials for a full list. Amongst others, it will determine how quickly a specific tool can mine it. | |
resistance |
How many seconds it takes to break the block (excluding speed mining bonus). Decimal numbers are allowed. | ||
creativeinventory |
arrays | In which creative inventory tabs the block should be visible in. | |
Rendering | |||
renderpass |
enum | opaque | Determines how the block will be drawn. |
opaque |
0 | Used for solid blocks with no half transparency. | |
opaquenocull |
1 | Used for non-solid single faced blocks, such as tall grass. | |
transparent |
2 | Use for solid halftransparent blocks, such as glass | |
liquid |
3 | Used for liquids, produces waves. | |
topsoil |
4 | Used for grass covered blocks. Allows for a smooth transition from grass to soil, while still allowing climate tinting of grass. | |
shape |
object | For the json drawtype, the shape definition of the block as shown in the world, dropped on the ground or held in hand. | |
base |
The path to the shape json file, the base dir is assets/shapes/. | ||
shapeinventory |
object | For the json drawtype, the shape definition of the block as shown in the players inventory. | |
base |
The path to the shape json file, the base dir is assets/shapes/. | ||
shapebytype |
object | When defining multiple block variants, use this property to selectively choose the shape of a variant. | |
ambientocclusion |
boolean | true | If ambient occlusion will be applied to the block. |
drawtype |
enum | cube | Determines how the block is tesselated, select JSON for being able to use custom JSON Models. The other values are hardcoded methods of tesselating the block. Check Drawtypes for a full list. |
blockLayer_1 |
0 | ||
blockLayer_2 |
1 | ||
blockLayer_3 |
2 | ||
blockLayer_4 |
3 | ||
blockLayer_5 |
4 | ||
blockLayer_6 |
5 | ||
blockLayer_7 |
6 | ||
json |
7 | Will draw a json model. | |
empty |
8 | Nothing will be drawn. | |
cube |
9 | Draws an ordinary cube. | |
cross |
10 | ||
transparent |
11 | ||
liquid |
12 | ||
crossandsnowlayer |
13 | ||
textures |
arrays | The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand. | |
texturesinventory |
arrays | The texture definitions for the block as seen in the player inventory. Overrides the textures definition if set. | |
texturesbytype |
arrays | When defining multiple block variants, use this property to selectively choose the textures of a variant. | |
SideOpaque |
directional object | ||
texturesinventorybytype |
arrays | When defining multiple block variants, use this property to selectively choose the inventory textures of a variant. | |
Sound | |||
sounds |
enum | The sounds to be played when a player interacts with this block. | |
place |
player/build | Sound to played when placing this block. | |
walk |
walk/default | Sound to played when walking on this block. | |
break |
player/destruct | Sound to played when breaking this block. | |
hit |
- | Currently unused. | |
inside |
- | Sound to played when moving inside block (only works for blocks that have no collisionbox, naturally). |