Table of Contents

Class BlockBehaviorUnstableFalling

Namespace
Vintagestory.GameContent
Assembly
VSSurvivalMod.dll

Spawns an EntityBlockFalling when the user places a block that has air underneath it or if a neighbor block is removed and causes air to be underneath it. Also has optional functionality to prevent a block being placed if it is unstable. Uses the code "UnstableFalling".

[DocumentAsJson]
[AddDocumentationProperty("AttachableFaces", "The faces that this block could be attached from which will prevent it from falling.", "System.String[]", "Optional", "None", false)]
[AddDocumentationProperty("AttachmentAreas", "A list of attachment areas per face that determine what blocks can be attached to.", "System.Collections.Generic.Dictionary{System.String,Vintagestory.API.Datastructures.RotatableCube}", "Optional", "None", false)]
[AddDocumentationProperty("AttachmentArea", "A single attachment area that determine what blocks can be attached to. Used if AttachmentAreas is not supplied.", "Vintagestory.API.Mathtools.Cuboidi", "Optional", "None", false)]
[AddDocumentationProperty("AllowUnstablePlacement", "Can this block be placed in an unstable position?", "System.Boolean", "Optional", "False", true)]
public class BlockBehaviorUnstableFalling : BlockBehavior
Inheritance
BlockBehaviorUnstableFalling

Fields

AttachableFaces (Optional) (Default: None)

The faces that this block could be attached from which will prevent it from falling.

Field Value

String[]

AttachmentArea (Optional) (Default: None)

A single attachment area that determine what blocks can be attached to. Used if AttachmentAreas is not supplied.

Field Value

Cuboidi

AttachmentAreas (Optional) (Default: None)

A list of attachment areas per face that determine what blocks can be attached to.

Field Value

Dictionary<String, RotatableCube>

dustIntensity (Optional) (Default: 0)

A multiplier for the number of dust particles for the falling block. A value of 0 means no dust particles.

[DocumentAsJson("Optional", "0", false)]
private float dustIntensity

Field Value

float

exceptions (Optional) (Default: None)

A list of block types which this block can always be attached to, regardless if there is a correct attachment area.

[DocumentAsJson("Optional", "None", false)]
private AssetLocation[] exceptions

Field Value

AssetLocation[]

fallSideways (Optional) (Default: False)

Can this block fall horizontally?

[DocumentAsJson("Optional", "False", false)]
public bool fallSideways

Field Value

bool

fallSidewaysChance (Optional) (Default: 0.3)

If fallSideways is enabled, this is the chance that the block will fall sideways instead of straight down.

[DocumentAsJson("Optional", "0.3", false)]
private float fallSidewaysChance

Field Value

float

fallSound (Optional) (Default: None)

The path to the sound to play when the block falls.

[DocumentAsJson("Optional", "None", false)]
private AssetLocation fallSound

Field Value

AssetLocation

ignorePlaceTest (Optional) (Default: False)

If true, then the block can be placed even in an position where it'll be unstable.

[DocumentAsJson("Optional", "False", false)]
private bool ignorePlaceTest

Field Value

bool

impactDamageMul (Optional) (Default: 1)

A multiplier of damage dealt to an entity when hit by the falling block. Damage depends on falling height.

[DocumentAsJson("Optional", "1", false)]
private float impactDamageMul

Field Value

float

Properties

AllowUnstablePlacement (Optional) (Default: False)

Can this block be placed in an unstable position?

Property Value

bool