# Sounds

Nexo allows you to register custom sounds that can be used in `/playsound`or other plugins\
The most basic of sounds can be configured like below by editing `plugins/Nexo/sounds.yml`

```yaml
sounds:
  - id: block.custom.mysound   # id: namespace:id
    sound: nexo:mysound.ogg    # References assets/nexo/sounds/mysound.ogg
    #sounds:                   # Optional, list of sounds where a random will be selected
    #  - mysound.ogg
    #  - mysound2.ogg
```

{% hint style="info" %}
If you are unsure how to reference a Sound OGG-file in a ConfigFile[FAQ](/general-usage/faq.md#how-do-i-reference-a-resourcepack-file-in-a-config)
{% endhint %}

There are also some more properties you can tweak if needed, but for majority of cases, the above default will be enough. A detailed explanation of each property can be found [here](https://minecraft.wiki/w/Sounds.json)

```yaml
#https://minecraft.wiki/w/Sounds.json
sounds:
  - id: nexo:music.something
    sound: nexo:music/something.ogg
    sounds:                                  # Alternative if you have more than 1 sound-file
      - nexo:music/something.ogg
      - nexo:music/something2.ogg
    stream: true                             # Optional, defaults to false
    preload: true                            # Optional, defaults to false
    volume: 1f                               # Optional, defaults to 1f
    pitch: 1f                                # Optional, defaults to 1f
    weight: 1                                # Optional, defaults to 1
    attenuation_distance: 13                 # Optional, defaults to 16
    jukebox_playable:                        # Optional, Used for registering a custom music-disc sound
      comparator_output: 15                  # Optional, defaults to 15, must be in 1..15
      range: X                               # Optional, If omitted, the sound will have a variable range.
      duration: 2.5s
      description: Description
```

There is also `jukebox_playable`which is used to register sounds used in custom music discs\
Nexo will generate the necessary datapack for this, which you can then reference in [JukeboxPlayable-Component](/configuration/items.md#components) of your item

#### Replacing sounds

If you wanna replace sounds already in minecraft, you can do so by doing

```yaml
sounds:
  - id: block.glass.place # removes vanilla sound
    sounds: []
    replace: true
  - id: block.glass.break # replaces vanilla sound with custom sound
    sound: nexo:customglasssound
    replace: true
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexomc.com/configuration/sounds.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
