Sound (Ambient)

Customize the sound the machine makes when running/idling/erroring.

You can define a sound that will play when the machine is in a specific status (corresponding of where you put the property in the appearance json).

The sound must be a OGG file and must be loaded in-game. Sounds are different than models and textures and must be registered to be usable so for using custom sounds you will have either to use a mod that let you add sounds to the game or replace an existing sound with a resource pack and use it's name in the property.

If no sound property is set the machine will just make no sound.

Ambient sound has 1 mandatory property and can be configured with 7 optional properties :

Mandatory property :

Sound

Name : sound

Description :

The id of the sound to play while the machine is in the specified status.

Example :

Use the vanilla furnace sound :

"ambient_sound" : {
    "sound": "minecraft:block.furnace.fire_crackle"
}

Optional properties :

Volume

Name : volume

Description :

A positive float value used to calculate the volume of the played sound.

Values higher than 1.0 will increase the volume and values between 0.0 and 1.0 will lower it.

Default : 1.0

Example :

The sound's volume will be doubled :

"ambient_sound": {
    "volume": 2.0
}
Pitch

Name : pitch

Description :

A positive float value used to calculate the pitch of the played sound.

Values higher than 1.0 will increase the pitch and values between 0.0 and 1.0 will lower it.

Default : 1.0

Example :

The sound's pitch will be doubled :

"ambient_sound": {
    "pitch": 2.0
}
Source

Name : source

Description :

One of Minecraft sound sources :

  • master

  • music

  • record

  • weather

  • block

  • hostile

  • neutral

  • player

  • ambient

  • voice

The player can adjust any of these sound sources in sound options.

Default : block

Example :

The machine's ambient sound will be played as "music" source :

"ambient_sound": {
    "source": "music"
}
Loop

Name : loop

Description :

A boolean value which set if the sound should be looped or not.

If set to false the machine will still play the sound continuously but there will be a short blank between each loop.

Default : true

Example :

Set the loop to false :

"ambient_sound": {
    "loop": false
}
Attenuation

Name : attenuation

Description :

A boolean value which set if the sound should be attenuated or not.

If set to true, the sound's volume will decrease as the player moves away the machine.

Default : true

Example :

Set the attenuation to false :

"ambient_sound": {
    "attenuation": false
}
Delay

Name : delay

Description :

A positive integer value that sets the amount (in game ticks) that will be waited before playing the sound.

Default : 0

Example :

Set the delay to 20 ticks (1 second) :

"ambient_sound": {
    "delay": 20
}
Relative

Name : relative

Description :

Not sure of what this property does.

Default : false

Example :

Set the relative to true :

"ambient_sound": {
    "relative": true
}

Example :

Simply add an ambient sound to the machine :

{
    "ambient_sound": "namespace:sound_location"
}

Add a configured ambient sound :

{
    "ambient_sound": {
        "sound": "namespace:sound_location",
        "volume": 2.0,
        "pitch": 2.0,
        "source": "music"
    }
}

Last updated