blocks.json

Source reference

{
    "blocks": [
        "blockSpec"
    ],
    "clearSounds": false,
    "soundChance": "0.01",
    "acoustics": null,
    "effects": null
}
Block Configuration

Property

Value Type

Comment

blocks

String Array

The block states for which the configuration options apply. At least one entry is required. See Block Specifications.

clearSounds

Boolean

Clears existing sound configuration for the blocks. Default is false.

soundChance

String

Script that provides the chance that a sound will be emitted. Default is 0.01. See Scripting.

acoustics

Acoustic Array

An array of acoustics that can play. Default is null. See Acoustics.

effects

Effect Array

An array of effects that can generate. Default is null. See Effect Configuration below.

{
    "effect": "effect",
    "conditions": "script",
    "spawnChance": null
}

Effect Configuration

Effect Configuration

Property

Value Type

Comment

effect

String

The type of effect. Possible values are FLAME_JET, BUBBLE_COLUMN, or FIRE_FLY.

conditions

String

Script that determines if the effect is eligible for activation. See Scripting.

spawnChance

String

Script that provides the spawn chance of the effect. Default is 0.01. See Scripting.

Examples

{
    "blocks": [
        "#dsurround:effects/fireflies"
    ],
    "effects": [
        {
            "effect": "firefly",
            "conditions": "weather.isNotRaining() && (diurnal.isNight() || diurnal.isSunset()) && !(HOT || weather.canWaterFreeze())",
            "spawnChance": "0.035"
        }
    ]
}

Firefly effect for any blocks that have the tag dsurround:effects/fireflies.

{
    "blocks": [
        "minecraft:nether_wart[age=3]"
    ],
    "effects": [
        {
            "effect": "fire_jet",
            "spawnChance": "0.005"
        }
    ]
}

Full grown Nether Wart spawning small flames on top.

{
    "blocks": [
        "minecraft:soul_sand"
    ],
    "soundChance": "0.000125",
    "acoustics": [
        {
            "factory": "dsurround:soulsand.laughter",
            "conditions": "dim.getId() == 'minecraft:the_nether'"
        }
    ]
}

Randomly play laughter sound for a Soul Sand block when in the Nether dimension.