Sounds and Music - clockworktownsmp/clockwork-bosses GitHub Wiki
Give your boss some personality! Each template can have event sounds for moments in the fight, voice lines when it lands a hit, and one music track for the arena.
config/clockwork-bosses/boss-templates/my_boss/
sounds/
spawn.ogg
phase2.ogg
death.ogg
boss_music.ogg
voice-lines/
voice01.ogg
Use OGG Vorbis, lowercase ASCII filenames, and no spaces or directory paths. Clients receive the selected audio from the server; they do not need a separate resource pack or local copy. Run /boss reload after adding or replacing files.
Set the filenames under:
sounds.spawn.filesounds.phase_change.filesounds.death.file
Leave the filename empty to disable that event sound. You can also set its volume, pitch, and audible range.
The spawn sound plays once when the dormant boss activates and begins emerging. /boss spawn itself is silent. Initial health-phase assignment is not a transition, so it does not play the phase-change sound.
A phase can override phases.<phase>.sounds.phase_change. Null or omitted fields inherit the shared phase-change sound. An explicit phase filename takes precedence even if the file is missing; "" mutes that transition.
Use mono clips for audio positioned at the boss and fading with distance. Stereo is accepted but lacks normal 3D positioning. A long clip keeps playing from the position where it started, so it won't follow a moving boss.
Custom event and voice playback follows Minecraft's Master/Hostile sliders, pause/resume behavior, category volume changes, and applicable /stopsound commands. Vanilla Warden audio has its own sounds.mob_volume: 0–1, default 0.25. This includes the heartbeat; custom OGGs retain their separate settings.
New templates and bundled presets use range: 0 for activation/spawn,
phase-change, death, voice-line and custom-roar audio. Zero means the arena's
radius or full 3D box diagonal, using inclusive lengths max - min + 1.
The source is boss_bar.visibility_area, not the activation trigger. The server
resolves this when a sound triggers, before media delivery. No usable arena in
the boss's dimension falls back to 32 blocks; playback is bounded to 1–512.
Positive manual distances keep their meaning. Older omitted/null base ranges
still mean 32, including what the native editor displays. Phase and legacy roar
null/missing overrides inherit; an explicit 0 chooses automatic distance.
Registered core roar action_settings.range uses its own declared default 0
when omitted or null. Legacy inherited roar lists omitted everywhere keep 32.
This is attenuation around the sound's starting position, not a strict arena membership filter. A boss outside a fixed box or underground can put an edge listener outside the sphere; nearby non-participants can hear clips. Encounter music continues to use arena membership. Install matching updated client/server jars; old clients can retain their previous 128-block attenuation cap.
Offline compilation, 189 focused distance assertions and the existing 5,216-assertion regression suite passed. Independent schema validation also accepted 14/rejected 11 existing fixtures and accepted 28/rejected 18 added audio-distance cases. This core update is packaged separately; no new in-game audio/latency test or server/client installation was performed. Those are historical checks from the initial spatial-audio update, now included in stable 0.2.0. The Workshop is separate from the mod and uses the connected schema/capabilities; real audio and latency checks remain separate.
Put voice files directly in that template's sounds/voice-lines/ folder. Discovery considers up to 64 valid filenames, ignores subfolders, and happens on load/reload. An empty folder is silent.
These are the default settings:
{
"voice_lines": {
"enabled": true,
"chance": 0.25,
"volume": 1.0,
"pitch": 1.0,
"range": 0.0
}
}| Field | Range or meaning |
|---|---|
chance |
0–1; 0.25 means a 25% roll. |
volume |
0–4. |
pitch |
0.5–2. |
range |
0 = automatic arena distance; positive = manual blocks, maximum 512. |
Each successful melee or Sonic Boom hit rolls once while the boss's voice is idle. Failed/blocked hits and cancelled charges do not roll. Attacks during a busy voice are skipped.
Each client allows only one pending or playing voice per boss, including while decoding or paused. On a slow connection, at most the latest waiting voice is retained; it expires after 8 seconds before transfer starts. Event sounds such as death remain independent.
Disabling voices prevents new lines and lets the current clip finish. An invalid selected clip is skipped until reload.
Roar lists live with their health phase. Their sound fields inherit the phase's roar.sound, then base attacks.roar.sound.
An empty roar filename uses the normal Warden roar. A custom filename with volume 0 gives a silent animation. See Phases and subphases for sequencing.
Place the track in the template's sounds/ folder, then add or edit this root section:
{
"music": {
"enabled": true,
"file": "boss_music.ogg",
"volume": 0.75,
"loop": true,
"fade_out_seconds": 2.0
}
}A blank filename disables music. Volume is 0–4. Fade-out is 0–10 seconds, default 2 seconds; 0 stops immediately. Music can be mono or stereo because it plays evenly across the arena without distance attenuation.
Music starts on activation for players in the selected boss-bar arena. Players who arrive late hear the track from the beginning; they don't join at a shared timestamp. Leaving, death, boss removal, and unload fade it out; disconnect stops it immediately. Dormant bosses do not play music.
Choose a channel in the GUI:
-
music: follows the Music slider and is the fallback for missing/invalid values. -
record: follows Jukebox/Note Blocks. -
master: follows Master only. - Other selectable native categories follow their own category behavior.
Every category follows Master. The selected channel affects live volume changes, category-specific /stopsound, and menu pause exemptions.
One encounter track plays per client. The most recently entered ready encounter takes priority, with up to 16 overlapping requests. Switching fades the previous track first. Vanilla ambient music is held during the boss track/fade, then resumes normal scheduling.
For the default music channel:
/stopsound @s music
This clears encounter requests until re-entry or /boss reload. Device/resource reloads resume eligible cached music from the beginning.
| Audio type | Maximum compressed size | Maximum duration |
|---|---|---|
| Event and voice clips, including custom roars | 1 MiB minus 1 KiB | 30 seconds |
| Encounter music | 8 MiB minus 1 KiB | 10 minutes |
Event/voice files also have a 4,096-page OGG limit, 128 KiB limits on each comment/setup header, and bounded Vorbis structure checks. Client decoded event/voice audio is capped at 8 MiB and 30 seconds. A file can still be rejected for oversized tags, unusually complex structures, or checksum failures, even if it has the right extension.
Media uses 16 KiB chunks with a 64 KiB in-flight window. First-use downloads can arrive late on slow connections. Music streams through the native decoder rather than allocating a full decoded track, and keeps a four-file compressed cache.
For a ready-made starting point, copy boss-sounds-example. No music track is bundled. See Templates and presets.
With a supported server login, the Workshop can list/play server sounds and upload OGG files into a draft. A local browser preview is not an upload. Save the draft, publish successfully, then run /boss reload for bosses already spawned.
Draft event/voice uploads allow at most 1 MiB minus 1 KiB / 30 seconds; music allows 8 MiB minus 1 KiB / 10 minutes. Filenames must be path-free lowercase OGG basenames, and the server validates the decoded content. Use mono for positional clips. See Workshop for backups and publication, or Workshop troubleshooting if a capability is missing.