Json block behaviors Unstable: Difference between revisions
From Vintage Story Wiki
(Created page with "== Purpose == Block can only be placed on a solid block and destroyed once the ground is removed. Used for: * Ore blasting bomb * Small carpet * Path * Turnip * Spelt * Soybe...") |
No edit summary |
||
Line 1: | Line 1: | ||
== Purpose == | == Purpose == | ||
This [[Modding:Json_Block_Behaviors|behavior]] turns the block into an [[Modding:Block_Attachment|attachment block]] that can be attached to any face listed in the <code>attachedToFaces</code> property. If the parent block is later changed such that it rejects the attachment, instead of immediately breaking the attachment block, it searches for another neighbor to attach to instead. The block is broken if none of the neighbors accept the attachment. | |||
== Used by blocks == | |||
* | * bunchocandles | ||
* | * crop | ||
* | * deadcrop | ||
* | * firepit | ||
* | * oreblastingbomb | ||
* | * silvertorchcactus | ||
* | * verticalboiler | ||
* | * wildbeehive | ||
* | * woodenpath | ||
* | * woodenrails | ||
== Properties == | == Properties == | ||
<code> attachedToFaces (default | ; <code>attachedToFaces</code>: (array of face codes, default : ["down"]) | ||
: The code of the variant group of the block that contains all of the facing codes. | |||
; <code>attachmentAreas</code>: (facing code -> RotatableCube) | |||
: The attachment area (part of the parent block that should be solid) for each face that the block can attach to. This field is optional. If a face is missing, then a null attachment area will be given to the parent block. Most parent blocks ignore the attachment area when deciding whether to accept an attachment. | |||
{{Navbox/modding|Vintage Story}} | {{Navbox/modding|Vintage Story}} |
Revision as of 09:12, 14 October 2023
Purpose
This behavior turns the block into an attachment block that can be attached to any face listed in the attachedToFaces
property. If the parent block is later changed such that it rejects the attachment, instead of immediately breaking the attachment block, it searches for another neighbor to attach to instead. The block is broken if none of the neighbors accept the attachment.
Used by blocks
- bunchocandles
- crop
- deadcrop
- firepit
- oreblastingbomb
- silvertorchcactus
- verticalboiler
- wildbeehive
- woodenpath
- woodenrails
Properties
attachedToFaces
: (array of face codes, default : ["down"])- The code of the variant group of the block that contains all of the facing codes.
attachmentAreas
: (facing code -> RotatableCube)- The attachment area (part of the parent block that should be solid) for each face that the block can attach to. This field is optional. If a face is missing, then a null attachment area will be given to the parent block. Most parent blocks ignore the attachment area when deciding whether to accept an attachment.
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 |