Difference between revisions of "Json:block:behaviors"

From Vintage Story Wiki
Jump to navigation Jump to search
Line 1: Line 1:
 +
== Adding behaviors to your block ==
 +
Block behaviors are an array of objects with properties attached to your block.
 +
Below is an example of two behaviors, one with properties and one without properties.
 +
<syntaxhighlight lang="json">
 +
  behaviors: [{name: "behavior1", properties: {myProperty1: "myValue1", myProperty2: "myValue2"},{name: "behavior2"}],
 +
</syntaxhighlight>
 +
== All Block Behaviors ==
 +
Here is a table containing all properties of the base game as of 1.9.
 
{| class="wikitable"
 
{| class="wikitable"
 
|-
 
|-

Revision as of 21:38, 25 March 2019

Adding behaviors to your block

Block behaviors are an array of objects with properties attached to your block. Below is an example of two behaviors, one with properties and one without properties.

  behaviors: [{name: "behavior1", properties: {myProperty1: "myValue1", myProperty2: "myValue2"},{name: "behavior2"}],

All Block Behaviors

Here is a table containing all properties of the base game as of 1.9.

Behavior Name Additional Properties Detail link
HorizontalAttachable handleDrops (bool, default: true) Horizontal Attachable
HorizontalOrientable dropBlockFace (Compass Direction, default: "North")
dropBlock (block name)
Horizontal Orientable
NWOrientable none North/West Orientable
Pillar none Pillar
Slab none Slab
HorizontalUpDownOrientable none Horizontal Up/Down Orientable
FiniteSpreadingLiquid liquidCollisionSound (path from sounds folder)
sourceReplacementCode (block code)
flowingReplacementCode (block code)
collidesWith (other liquid)
spreadDelay (int, default: 150)
Finite Spreading Liquid
OmniAttachable facingPos (int, default: 1) Omni-Attachable
Unplaceable none Unplaceable
Unstable attachedToFaces (default: down) Unstable
Harvestable none Harvestable
NoParticles none No Particles
Container none Container
Ignitable none Ignitable
UnstableFalling none Unstable Falling
BreakIfFloating none Break if Floating
CanIgnite none Can Ignite
ExchangeOnInteract exchangeStates (string array of block states)
sounds (path from sounds folder)
Exchange On Interact
OmniRotatable rotateH (bool, default: false)
rotateV (bool, default: false)
rotatev4 (bool, default: false)
rotateSides (bool, default: false)
facing (string)
Omni-Rotatable
Ladder dropBlockFace (face direction, Default: north) Ladder
PushEventOnBlockBroken string EventName Push Event on Block Broken
RightClickPickup none Right Click Pickup
SneakPlacing none Sneak Placing