Modding:Json Block Behaviors

From Vintage Story Wiki
Jump to navigation Jump to search

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 Example Blocks Detail link
BreakIfFloating none rock Break if Floating
CanIgnite none torch Can Ignite
CollectFrom none henbox Collect From
Container none barrel, chest Container
ExchangeOnInteract exchangeStates (string array of block states)
sounds (path from sounds folder)
trapdoor Exchange On Interact
FiniteSpreadingLiquid liquidCollisionSound (path from sounds folder)
sourceReplacementCode (block code)
flowingReplacementCode (block code)
collidesWith (other liquid)
spreadDelay (int, default: 150)
water, lava Finite Spreading Liquid
Harvestable none bigberrybush, smallberrybush Harvestable
HorizontalAttachable handleDrops (bool, default: true) painting, shelf, toolrack Horizontal Attachable
HorizontalOrientable dropBlockFace (Compass Direction, default: "North")
dropBlock (block name)
bloomerybase, chest, skep Horizontal Orientable
HorizontalUpDownOrientable none - Horizontal Up/Down Orientable
Ignitable none charcoalpit Ignitable
Ladder dropBlockFace (face direction, Default: north) ladder Ladder
Lockable none chest, displaycase, door, trapdoor Lockable
NoParticles none - No Particles
NWOrientable none chimney, mannequin, path North/West Orientable
OmniAttachable facingPos (int, default: 1) lantern Omni-Attachable
OmniRotatable rotateSides (bool, default: false)
facing (string)
all slabs Omni-Rotatable
Pillar none axle, log Pillar
PushEventOnBlockBroken string EventName - Push Event on Block Broken
RightClickPickup none bucket, toolmold Right Click Pickup
Slab none plankslab, cobbleslab (all slabs) Slab
SneakPlacing none crock Sneak Placing
Unplaceable none pan Unplaceable
Unstable attachedToFaces (default: down) all crops Unstable
UnstableFalling none anvil, gravel, sand Unstable Falling


Main Page: Modding
Green Items require C# coding
Basics

Getting Started | Mod Types | Simple Examples

Asset System | Textures | Items | Recipes | Blocks | Model Creator | Animation Basics | VTML & Icons | Mod Packaging & Release | Modinfo | Debugging

Advanced

JSON Patching | Advanced JSON Items | The Remapper | Server-Client Considerations

Setting Up Your Development Environment (General - Windows - Linux)

Advanced Blocks | Advanced Items | Item-Block Interactions | Block Behavior | Block Entities | Particle Effects | World Access | Inventory Handling | Chat Commands | GUIs | Server-Client Networking | Monkey patching (Harmony)

Data Management

Savegame Data Storage | ModConfig File | Chunk Data Storage | Tree Attribute

Worldgen

WorldGen Concepts | Terrain | Ores | Trees | WorldGen API

Rendering

Shaders and Renderers

Property Overview

Item | Entity | Block | Block Behaviors | Block Classes | Block Entities | Block Entity Behaviors

Workflows & Infrastructure

Modding Efficiency Tips | Mod Extensibility | Load Order

Additional Resources

List of server commands | List of client commands | Client startup parameters | Creative Starter Guide | ServerBlockTicking | Bot System | WorldEdit | Cinematic Camera

Example Mods | API Docs | GitHub Repository