Modding:Json Block Behaviors: Difference between revisions
From Vintage Story Wiki
VeryGoodDog (talk | contribs) m (VeryGoodDog moved page Json:block:behaviors to Modding:Json Block Behaviors) |
(→All Block Behaviors: Add block behaviors from vsessentialsmod.) |
||
Line 10: | Line 10: | ||
|- | |- | ||
! Behavior Name !! Additional Properties !! Example Blocks !! Detail link | ! Behavior Name !! Additional Properties !! Example Blocks !! Detail link | ||
|- | |||
| BlockEntityInteract || none || door || [[Json_block_behaviors_BlockEntityInteract| Block Entity Interact]] | |||
|- | |- | ||
| BreakIfFloating || none || rock || [[Json_block_behaviors_BreakIfFloating| Break if Floating]] | | BreakIfFloating || none || rock || [[Json_block_behaviors_BreakIfFloating| Break if Floating]] | ||
Line 18: | Line 20: | ||
|- | |- | ||
| Container || none || barrel, chest || [[Json_block_behaviors_Container|Container]] | | Container || none || barrel, chest || [[Json_block_behaviors_Container|Container]] | ||
|- | |||
| Decor || sides, sidedVariants, nwOrientable, drawIfCulled, alternateZOffset, notFullFace, removable, thickness || linen, mediumcarpet, rushmat, smallcarpet, wallpaper, wool, hotspringbacteriasmooth, hotspringbacteria, attachingplant, overlay, overlay, oxidation, transition, fallenleaves, caveart | |||
|| [[Json_block_behaviors_Decor|Decor]] | |||
|- | |- | ||
| ExchangeOnInteract || exchangeStates (string array of block states) <br> sounds (path from sounds folder) || trapdoor || [[Json_block_behaviors_ExchangeOnInteract|Exchange On Interact]] | | ExchangeOnInteract || exchangeStates (string array of block states) <br> sounds (path from sounds folder) || trapdoor || [[Json_block_behaviors_ExchangeOnInteract|Exchange On Interact]] | ||
Line 36: | Line 41: | ||
|- | |- | ||
| Lockable|| none || chest, displaycase, door, trapdoor|| [[Json_block_behaviors_Lockable|Lockable]] | | Lockable|| none || chest, displaycase, door, trapdoor|| [[Json_block_behaviors_Lockable|Lockable]] | ||
|- | |||
| Multiblock|| sizex, sizey, sizez, type, cposition || jonas, riftward, verticalboiler, banner, trunk, painting | |||
|| [[Json_block_behaviors_Multiblock|Multiblock]] | |||
|- | |- | ||
| NoParticles || none || - || [[Json_block_behaviors_NoParticles|No Particles]] | | NoParticles || none || - || [[Json_block_behaviors_NoParticles|No Particles]] | ||
Line 50: | Line 58: | ||
|- | |- | ||
| RightClickPickup || none || bucket, toolmold || [[Json_block_behaviors_RightClickPickup|Right Click Pickup]] | | RightClickPickup || none || bucket, toolmold || [[Json_block_behaviors_RightClickPickup|Right Click Pickup]] | ||
|- | |||
| RopeTieable || none || roughhewnfence, woodenfence || [[Json_block_behaviors_RopeTieable|Rope Tieable]] | |||
|- | |- | ||
| Slab || none || plankslab, cobbleslab (all slabs) || [[Json_block_behaviors_slab|Slab]] | | Slab || none || plankslab, cobbleslab (all slabs) || [[Json_block_behaviors_slab|Slab]] |
Revision as of 20:30, 10 October 2023
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 |
---|---|---|---|
BlockEntityInteract | none | door | Block Entity Interact |
BreakIfFloating | none | rock | Break if Floating |
CanIgnite | none | torch | Can Ignite |
CollectFrom | none | henbox | Collect From |
Container | none | barrel, chest | Container |
Decor | sides, sidedVariants, nwOrientable, drawIfCulled, alternateZOffset, notFullFace, removable, thickness | linen, mediumcarpet, rushmat, smallcarpet, wallpaper, wool, hotspringbacteriasmooth, hotspringbacteria, attachingplant, overlay, overlay, oxidation, transition, fallenleaves, caveart | Decor |
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 |
Multiblock | sizex, sizey, sizez, type, cposition | jonas, riftward, verticalboiler, banner, trunk, painting | Multiblock |
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 |
RopeTieable | none | roughhewnfence, woodenfence | Rope Tieable |
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 |
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 | Item • Entity • Block • Block Behaviors • Block Classes • Block Entities • Block Entity Behaviors • World properties |
Workflows & Infrastructure | Modding Efficiency Tips • Mod-engine compatibility • Mod Extensibility • VS Engine |
Additional Resources | Community Resources • Modding API Updates • Programming Languages • List of server commands • List of client commands • Client startup parameters • Server startup parameters Example Mods • API Docs • GitHub Repository |