Modding:Json Block Behaviors: Difference between revisions

From Vintage Story Wiki
Line 11: Line 11:
! Behavior Name !! Additional Properties !! Detail link
! Behavior Name !! Additional Properties !! Detail link
|-
|-
| HorizontalAttachable || handleDrops (bool, default: true) || [[Json_block_behaviors_horizontalattachable|Horizontal Attachable]]
| BreakIfFloating || none || [[Json_block_behaviors_BreakIfFloating| Break if Floating]]
|-
|-
| HorizontalOrientable || dropBlockFace (Compass Direction, default: "North") <br> dropBlock (block name) || [[Json_block_behaviors_horizontalorientable|Horizontal Orientable]]
| CanIgnite || none || [[Json_block_behaviors_CanIgnite|Can Ignite]]
|-
|-
| NWOrientable || none || [[Json_block_behaviors_NWOrientable|North/West Orientable]]
| CollectFromThis || none || [[Json_block_behaviors_CollectFromThis|Collect From This]]
|-
|-
| Pillar || none || [[Json_block_behaviors_pillar|Pillar]]
| Container || none || [[Json_block_behaviors_Container|Container]]
|-
|-
| Slab || none || [[Json_block_behaviors_slab|Slab]]
| ExchangeOnInteract || exchangeStates (string array of block states) <br> sounds (path from sounds folder) || [[Json_block_behaviors_ExchangeOnInteract|Exchange On Interact]]
|-
| HorizontalUpDownOrientable || none || [[Json_block_behaviors_HorizontalUpDownOrientable| Horizontal Up/Down Orientable]]
|-
|-
| FiniteSpreadingLiquid || liquidCollisionSound (path from sounds folder) <br> sourceReplacementCode (block code) <br> flowingReplacementCode (block code) <br> collidesWith (other liquid) <br> spreadDelay (int, default: 150) || [[Json_block_behaviors_FiniteSpreadingLiquid| Finite Spreading Liquid]]
| FiniteSpreadingLiquid || liquidCollisionSound (path from sounds folder) <br> sourceReplacementCode (block code) <br> flowingReplacementCode (block code) <br> collidesWith (other liquid) <br> spreadDelay (int, default: 150) || [[Json_block_behaviors_FiniteSpreadingLiquid| Finite Spreading Liquid]]
|-
|-
| OmniAttachable || facingPos (int, default: 1)|| [[Json_block_behaviors_OmniAttachable|Omni-Attachable]]
| Harvestable || none || [[Json_block_behaviors_Harvestable|Harvestable]]
|-
|-
| Unplaceable || none || [[Json_block_behaviors_Unplaceable|Unplaceable]]
| HorizontalAttachable || handleDrops (bool, default: true) || [[Json_block_behaviors_horizontalattachable|Horizontal Attachable]]
|-
|-
| Unstable || attachedToFaces (default: down) || [[Json_block_behaviors_Unstable|Unstable]]
| HorizontalOrientable || dropBlockFace (Compass Direction, default: "North") <br> dropBlock (block name) || [[Json_block_behaviors_horizontalorientable|Horizontal Orientable]]
|-
|-
| Harvestable || none || [[Json_block_behaviors_Harvestable|Harvestable]]
| HorizontalUpDownOrientable || none || [[Json_block_behaviors_HorizontalUpDownOrientable| Horizontal Up/Down Orientable]]
|-
| NoParticles || none || [[Json_block_behaviors_NoParticles|No Particles]]
|-
| Container || none || [[Json_block_behaviors_Container|Container]]
|-
|-
| Ignitable || none || [[Json_block_behaviors_ignitable|Ignitable]]
| Ignitable || none || [[Json_block_behaviors_ignitable|Ignitable]]
|-
|-
| UnstableFalling || none || [[Json_block_behaviors_UnstableFalling| Unstable Falling]]
| Ladder || dropBlockFace (face direction, Default: north)|| [[Json_block_behaviors_Ladder|Ladder]]
|-
|-
| BreakIfFloating || none || [[Json_block_behaviors_BreakIfFloating| Break if Floating]]
| NoParticles || none || [[Json_block_behaviors_NoParticles|No Particles]]
|-
|-
| CanIgnite || none || [[Json_block_behaviors_CanIgnite|Can Ignite]]
| NWOrientable || none || [[Json_block_behaviors_NWOrientable|North/West Orientable]]
|-
|-
| ExchangeOnInteract || exchangeStates (string array of block states) <br> sounds (path from sounds folder) || [[Json_block_behaviors_ExchangeOnInteract|Exchange On Interact]]
| OmniAttachable || facingPos (int, default: 1)|| [[Json_block_behaviors_OmniAttachable|Omni-Attachable]]
|-
|-
| OmniRotatable || rotateH (bool, default: false) <br> rotateV (bool, default: false) <br> rotatev4 (bool, default: false) <br> rotateSides (bool, default: false) <br> facing (string)|| [[Json_block_behaviors_OmniRotatable|Omni-Rotatable]]
| OmniRotatable || rotateH (bool, default: false) <br> rotateV (bool, default: false) <br> rotatev4 (bool, default: false) <br> rotateSides (bool, default: false) <br> facing (string)|| [[Json_block_behaviors_OmniRotatable|Omni-Rotatable]]
|-
|-
| Ladder || dropBlockFace (face direction, Default: north)|| [[Json_block_behaviors_Ladder|Ladder]]
| Pillar || none || [[Json_block_behaviors_pillar|Pillar]]
|-
|-
| PushEventOnBlockBroken || string EventName || [[Json_block_behaviors_PushEventOnBlockBroken|Push Event on Block Broken]]
| PushEventOnBlockBroken || string EventName || [[Json_block_behaviors_PushEventOnBlockBroken|Push Event on Block Broken]]
Line 55: Line 49:
| RightClickPickup || none || [[Json_block_behaviors_RightClickPickup|Right Click Pickup]]
| RightClickPickup || none || [[Json_block_behaviors_RightClickPickup|Right Click Pickup]]
|-
|-
| CollectFromThis || none || [[Json_block_behaviors_CollectFromThis|Collect From This]]
| Slab || none || [[Json_block_behaviors_slab|Slab]]
|-
|-
| SneakPlacing || none || [[Json_block_behaviors_SneakPlacing|Sneak Placing]]
| SneakPlacing || none || [[Json_block_behaviors_SneakPlacing|Sneak Placing]]
|-
| Unplaceable || none || [[Json_block_behaviors_Unplaceable|Unplaceable]]
|-
| Unstable || attachedToFaces (default: down) || [[Json_block_behaviors_Unstable|Unstable]]
|-
| UnstableFalling || none || [[Json_block_behaviors_UnstableFalling| Unstable Falling]]
|}
|}


{{Navbox/modding|Vintage Story}}
{{Navbox/modding|Vintage Story}}

Revision as of 05:52, 30 April 2020

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

Wondering where some links have gone?
The modding navbox is going through some changes! Check out Navigation Box Updates for more info and help finding specific pages.

Modding
Modding Introduction Getting Started Theme Pack
Content Modding Content Mods Developing a Content Mod Basic Tutorials Intermediate Tutorials Advanced Tutorials Content Mod Concepts
Code Modding Code Mods Setting up your Development Environment
Property Overview ItemEntityBlockBlock BehaviorsBlock ClassesBlock EntitiesBlock Entity BehaviorsWorld properties
Workflows & Infrastructure Modding Efficiency TipsMod-engine compatibilityMod ExtensibilityVS Engine
Additional Resources Community Resources Modding API Updates Programming Languages List of server commandsList of client commandsClient startup parametersServer startup parameters
Example ModsAPI DocsGitHub Repository