Table of Contents

Class BlockSounds

Namespace
Vintagestory.API.Common
Assembly
VintagestoryAPI.dll

A set of sounds that are defined for a block. All fields use default or empty sounds if not set.

public class BlockSounds
Inheritance
BlockSounds
Inherited Members
Extension Methods

Examples

"sounds": {
	"place": "block/dirt",
	"break": "block/dirt",
	"hit": "block/dirt",
	"walk": "walk/grass"
},

Fields

Ambient

Played in ambience for this block.

public AssetLocation Ambient

Field Value

AssetLocation

AmbientBlockCount

Amount of nearby ambient sound blocks in order to reach full ambient sound volume

public float AmbientBlockCount

Field Value

float

AmbientMaxDistanceMerge

Adjacent ambient sound sources are merged to avoid playing too many sounds too loudly. This is the maximum distance a sound source can be from another to allow a merge.

public float AmbientMaxDistanceMerge

Field Value

float

AmbientSoundType

The type of sound for this block's ambient sound.

public EnumSoundType AmbientSoundType

Field Value

EnumSoundType

Properties

Break

Played when this block is broken.

public virtual AssetLocation Break { get; set; }

Property Value

AssetLocation

ByTool

Gets the sound that occurs when a specific tool hits a block.

public virtual Dictionary<EnumTool, BlockSounds> ByTool { get; set; }

Property Value

Dictionary<EnumTool, BlockSounds>

Hit

Played when this block is hit. Will be overridden by ByTool if an appropriate tool is set.

public virtual AssetLocation Hit { get; set; }

Property Value

AssetLocation

Inside

Played when an entity moves inside this block. Primarily used for liquids.

public virtual AssetLocation Inside { get; set; }

Property Value

AssetLocation

Place

Played when this block is placed.

public virtual AssetLocation Place { get; set; }

Property Value

AssetLocation

Walk

Played when an entity walks on this block.

public virtual AssetLocation Walk { get; set; }

Property Value

AssetLocation

Methods

Clone()

Clones the block sounds.

public BlockSounds Clone()

Returns

BlockSounds

GetBreakSound(EnumTool)

Gets the break sound either by the tool or by the block if the tool does not have a break sound.

public AssetLocation GetBreakSound(EnumTool tool)

Parameters

tool EnumTool

The Tool used.

Returns

AssetLocation

The resulting sound

GetBreakSound(IPlayer)

Gets the breaking sound, either provided by the tool or by this sound.

public AssetLocation GetBreakSound(IPlayer byPlayer)

Parameters

byPlayer IPlayer

Returns

AssetLocation

GetHitSound(EnumTool)

Gets the hit sound either by the tool or by the block if the tool does not have a hit sound.

public AssetLocation GetHitSound(EnumTool tool)

Parameters

tool EnumTool

Returns

AssetLocation

GetHitSound(IPlayer)

Gets the hit sound either provided by the tool or by the block.

public AssetLocation GetHitSound(IPlayer byPlayer)

Parameters

byPlayer IPlayer

Returns

AssetLocation

OnDeserializedMethod(StreamingContext)

[OnDeserialized]
public void OnDeserializedMethod(StreamingContext context)

Parameters

context StreamingContext