Skip to main content

Get 25% OFF on your first order with BisectHosting using code "DAQEM"!

Play Sound

The arc:play_sound reward type plays a specific sound event at a target location.

Parameters

ParameterTypeRequiredDefaultDescription
soundSoundEventRequired-No default valueThe sound event to play.
volumefloatOptional1Volume.
pitchfloatOptional1Pitch.
positionArcPositionTargetOptionalPLAYERPosition to play sound.
sound_sourceSoundSourceOptionalPLAYERSSource category.

Example

The following example plays a level-up sound when the player gains experience.

data/my_datapack/arc/ding.json
{
"holder": {
"type": "arc:player",
"id": "arc:player"
},
"type": "arc:on_pickup_item",
"conditions": [
{
"type": "arc:entity_type",
"entity_type": "minecraft:experience_orb"
}
],
"rewards": [
{
"type": "arc:play_sound",
"sound": "minecraft:entity.player.levelup",
"volume": 0.5,
"pitch": 1.0,
"position": "PLAYER",
"sound_source": "PLAYERS"
}
]
}

Compatible Action Types