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.


Block can only be placed on a solid block and destroyed once the ground is removed. Used for:
== Used by blocks ==
* Ore blasting bomb
* bunchocandles
* Small carpet
* crop
* Path
* deadcrop
* Turnip
* firepit
* Spelt
* oreblastingbomb
* Soybean
* silvertorchcactus
* Rye
* verticalboiler
* Rice
* wildbeehive
* Parsnip
* woodenpath
* Onion
* woodenrails
* Flax
* Carrot


== Properties ==
== Properties ==
<code> attachedToFaces (default: down) </code> The faces that this block can be attached to.  
; <code>attachedToFaces</code>&colon; (array of face codes, default &colon; ["down"])
: The code of the variant group of the block that contains all of the facing codes.
; <code>attachmentAreas</code>&colon; (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}}