Skip to content

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% [fadein %fade_time%]] (--loop)

Play sound effect:

sfx start %namespace:category.name% [%volume% %pitch% [fadein %fade_time%]] (--loop)

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 all
sfx stop all
sound stop all

INFO

If no namespace is provided, minecraft is used as the default.

Parameters

  • %namespace:category.name% (string, required): Sound identifier with optional namespace.
  • %volume% (float, optional): Volume level (e.g., 0.5 for half volume).
  • %pitch% (float, optional): Pitch level (e.g., 1.2 for higher pitch).
  • loop (argument, optional): Whether to loop the sound.
  • 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 fadein 2 --loop
  • sfx start sfx.page_turn 1 1
  • song stop narrativecraft:music.intro fadeout 3
  • sfx stop sfx.page_turn
  • song stop all
  • sound stop all