Modding:Json Block Behaviors: Difference between revisions

From Vintage Story Wiki
→‎All Block Behaviors: Update HorizontalOrientable link
(→‎All Block Behaviors: Use bullet lists for the properties)
(→‎All Block Behaviors: Update HorizontalOrientable link)
 
(One intermediate revision by the same user not shown)
Line 1: Line 1:
== Adding behaviors to your block ==
== Adding behaviors to your block ==
Block behaviors are an array of objects with properties attached to your block. They are added through the <code>behaviours</code> field at the top level (same level as the <code>code</code> field) of a block json file.
Block behaviors are an array of objects with properties attached to your block. They are added through the <code>behaviors</code> field at the top level (same level as the <code>code</code> field) of a block json file.
Below is an example of two behaviors, one with properties and one without properties.
Below is an example of two behaviors, one with properties and one without properties.
<syntaxhighlight lang="json">
<syntaxhighlight lang="json">
Line 91: Line 91:
| tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack
| tapestry, torchholder, mushroom, canvas, moldrack, painting, shelf, toolrack
|-
|-
| [[Json_block_behaviors_horizontalorientable|HorizontalOrientable]]
| [[Modding:HorizontalOrientable_behavior|HorizontalOrientable]]
|
|
* dropBlockFace (Compass Direction, default: "North")
* dropBlockFace (Compass Direction, default: "North")
Confirmedusers
261

edits