Modding:Block Json Properties: Difference between revisions

From Vintage Story Wiki
No edit summary
No edit summary
Line 275: Line 275:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">textures</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_textures" data-tt-parent="root">textures</div></td>
     <td>key: direction, value: [[JSON - Texture|texture]]</td>
     <td>key: direction, value: texture</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.</td>
Line 308: Line 308:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_texturesinventory" data-tt-parent="root">texturesinventory</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_texturesinventory" data-tt-parent="root">texturesinventory</div></td>
     <td>key: direction, value: [[JSON - Texture|texture]]</td>
     <td>key: direction, value: texture</td>
     <td></td>
     <td></td>
     <td>The texture definitions for the block as seen in the player inventory. Overrides the textures definition if set.</td>
     <td>The texture definitions for the block as seen in the player inventory. Overrides the textures definition if set.</td>
Line 314: Line 314:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_texturesbytype" data-tt-parent="root">texturesbytype</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_texturesbytype" data-tt-parent="root">texturesbytype</div></td>
     <td>key: string -> direction, value: [[JSON - Texture|texture]]</td>
     <td>key: string -> direction, value: texture</td>
     <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>
Line 320: Line 320:
   <tr>
   <tr>
     <td scope="row"><div class="tt" data-tt-id="p_texturesinventorybytype" data-tt-parent="root">texturesinventorybytype</div></td>
     <td scope="row"><div class="tt" data-tt-id="p_texturesinventorybytype" data-tt-parent="root">texturesinventorybytype</div></td>
     <td>key: string -> direction, value: [[JSON - Texture|texture]]</td>
     <td>key: string -> direction, value: texture</td>
     <td></td>
     <td></td>
     <td>When defining multiple block variants, use this property to selectively choose the inventory textures of a variant.</td>
     <td>When defining multiple block variants, use this property to selectively choose the inventory textures of a variant.</td>

Revision as of 13:00, 20 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
string (of 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
shape 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/.
rotateX
float 0
rotateY
float 0
rotateZ
float 0
shapeinventory
shape 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/.
rotateX
float 0
rotateY
float 0
rotateZ
float 0
shapebytype
key: string, value: shape 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
string (of 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
key: direction, value: texture The texture definitions for the block as seen in the world, when dropped on the ground or held in the hand.
base
Default example (glass):
textures: {
		all: { base: "glass" },
	}
Using variantgroups (rock):
textures: {
		all: {base: "stone/rock/{rock}" },
	}

Using directions (hay block):

textures: {
		horizontals: { base: "hay/{type}-side" },
		verticals: { base: "hay/{type}-top" },
	},
overlays


alternates
Overlay and alternate textures combined (ore):
textures: {
		all: {
			base: "stone/rock/{rock}",
			overlays: [ "stone/ore/{ore}1" ],
			alternates: [
				{ base: "stone/rock/{rock}", overlays: [ "stone/ore/{ore}2" ] },
				{ base: "stone/rock/{rock}", overlays: [ "stone/ore/{ore}3" ] }
			]
		}
	},
texturesinventory
key: direction, value: texture The texture definitions for the block as seen in the player inventory. Overrides the textures definition if set.
texturesbytype
key: string -> direction, value: texture When defining multiple block variants, use this property to selectively choose the textures of a variant.
texturesinventorybytype
key: string -> direction, value: texture When defining multiple block variants, use this property to selectively choose the inventory textures of a variant.
sideopaque
key: direction, value: boolean
all

east

west

up

down

north

south
sidesolid
key: direction, value: boolean
all

east

west

up

down

north

south
Sound
sounds
key: string, value: string 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).