Play Sound (Entity Action Type)

Plays a sound event at the entity's position.

Plays a sound event at the entity’s position.

Type ID: apoli:play_sound

!!! note

The value of the volume field is used to multiply the base distance of the sound event, which is 16 blocks (1.0).

Fields

FieldTypeDefaultDescription
soundIdentifierThe ID of the sound event to play.
categoryStringoptionalIf specified, this specifies the category and options the sound event falls under. Otherwise, uses the category specified in the entity that invoked this action. Accepts "master", "music", "record", "weather", "block", "hostile", "neutral", "players", "ambient" or "voice".
volumeFloat1.0The volume of the sound event.
pitchFloat1.0The pitch of the sound event.

Examples

"entity_action": {
    "type": "apoli:play_sound",
    "sound": "minecraft:entity.chicken.egg"
}

This example will play the minecraft:entity.chicken.egg sound event that can be heard within a 16 blocks distance. (16 * 1.0 = 16)

"entity_action": {
    "type": "apoli:play_sound",
    "sound": "minecraft:entity.enderman.death",
    "volume": 1.5
}

This example will play the minecraft:entity.enderman.death sound event that can be heard within a 24 blocks distance. (16 * 1.5 = 24)