Compatibility
Minecraft: Java Edition
Platforms
Supported environments
Tags
Creators
Details
Play your own music in Minecraft and keep everyone on the same second of the song. Use sound events, ogg files from a resource pack, a direct link to an ogg, mp3 or wav file, or any link: YouTube, SoundCloud, videos...
Commands:
/soundtrack <play/stop/list>
/soundtrack play <id> resource <sound> [volume] [fadeinTicks] [fadeoutTicks] [loop] [fadeloop] [pitch] [category]
/soundtrack play <id> url <link> [volume] ...
/soundtrack stop <id/all> [fadeoutTicks]
Pick resource and the tab completion shows your soundtracks folder files, modded and vanilla sounds. Pick url and paste the link. No quotes needed.
Soundtracks folder
Put your .ogg files in assets/<namespace>/soundtracks/ inside a resource pack, no sounds.json needed. Press F3+T and they show up in the tab completion as namespace:soundtracks/song.ogg.
Links
Paste a direct link to an ogg, mp3 or wav file and it plays. Each player downloads it once and keeps it cached.
Links to pages like YouTube or SoundCloud and to videos (mp4, webm...) work too. The first time you use one, the mod quietly downloads the free tools it needs (yt-dlp, deno and ffmpeg) from their official pages, nothing to install by hand.
Players can turn links off in config/soundtrackplayer.json.
Always in sync
If someone joins late, leaves and comes back, or reloads their resource packs, the song picks up at the same second as everyone else. Loops too. F3+T and the pause menu don't cut the music anymore.
Fades, loops and categories
- fadein / fadeout: in ticks (20 = 1 second)
- stop with a fade: the fadeout in stop overrides the one the song was started with. Leave it empty and it uses the original one
- fadeloop: true fades every lap of a loop in and out, false only fades the first start and the stop
- pitch: 0.5 to 2.0, it changes the speed too
- category: SOUNDTRACKS by default, or any vanilla one like MUSIC, AMBIENT or RECORDS so it follows that slider
Running the same command again with the same id and sound changes the volume, pitch or fades live, the song keeps going from where it was. Your own soundtracks also keep playing after leaving and joining a world.
Soundtracks slider
There's a new "Soundtracks" slider in Music & Sounds to control the volume of every soundtrack in the SOUNDTRACKS category. It's translated to 20 languages.
Servers
- Paper/Spigot: use the SoundtrackplayerPLUGIN plugin:
/soundtrackplugin play <@a/player> <id> <url/resource> <link/sound> ...and/soundtrackplugin stop <@a/player> <id/all> [fadeoutTicks]. It saves everything, so players that join later hear the same thing at the same time. Tab completion shows the ids that are actually playing and the custom sounds your players have. - Singleplayer, Fabric, NeoForge and Forge servers: use the API from your own mod.
API
Server side (every loader, singleplayer included):
Soundtrack boss = Soundtrack.builder("boss", "soundtrackplayer:soundtracks/boss.ogg")
.volume(0.8f).fadeIn(40).fadeOut(60).loop(true).build();
SoundtrackPlayerAPI.playForAll(server, boss);
SoundtrackPlayerAPI.play(player, boss);
SoundtrackPlayerAPI.stopForAll(server, "boss", 100);
Client side: SoundtrackClientAPI to play local tracks, stop them, read or change the Soundtracks volume and listen to tracks starting and stopping.
Plugin: SoundtrackPlayerAPI.get() with the same methods for Paper plugins, plus SoundtrackClientReadyEvent when a player with the mod joins.
Source code and docs: https://github.com/Cotiiii/soundtrackplayer
Available for Fabric 1.20.1 - 26.2, NeoForge 1.20.1 - 26.2 and Forge 1.20.1 / 1.20.4.


