Song/Sfx
Play sound from Minecraft. Sounds must be registered in Minecraft’s sounds.json.
Syntax
Play song:
song start %namespace:category.name% [%volume% %pitch% [loop=true/false] [fadein %fade_time%]]Play sound effect:
sfx start %namespace:category.name% [%volume% %pitch% [loop=true/false] [fadein %fade_time%]]Stop song:song stop %namespace:category.name% [fadeout %fade_time%]
Stop sound effect:sfx stop %namespace:category.name% [fadeout %fade_time%]
Stop all:song stop allsfx stop allsound stop all
INFO
If no namespace is provided, minecraft is used as the default.
Parameters
%namespace:category.name%(string): Sound identifier with optional namespace. Defaults tominecraftif omitted.%volume%(float, optional): Volume level (e.g.,0.5for half volume).%pitch%(float, optional): Pitch level (e.g.,1.2for higher pitch).loop(boolean, optional): Whether to loop the sound (trueorfalse).fadein %fade_time%(float, optional): Fade-in duration in seconds when starting sound.fadeout %fade_time%(float, optional): Fade-out duration in seconds when stopping sound.
Examples
song start narrativecraft:music.intro 0.8 1 true fadein 2
Starts playing the intro music at 80% volume, normal pitch, looping with a 2-second fade-in.
sfx start sfx.page_turn 1 1
Plays the page turn sound effect at full volume and normal pitch.
song stop narrativecraft:music.intro fadeout 3
Stops the intro music, fading out over 3 seconds.
sfx stop sfx.page_turn
Immediately stops the page turn sound effect.
song stop all
Stops all currently playing songs.
sound stop all
Stops all songs and sound effects immediately.