Minecraft:Commands/music: Difference between revisions
More actions
Remove broken links to missing pages |
Fix template calls: add MC/ prefix |
||
| Line 1: | Line 1: | ||
{{ | {{MC/Exclusive|bedrock|education}} | ||
{{Infobox command | {{Infobox command | ||
|name=music | |name=music | ||
| Line 19: | Line 19: | ||
== Arguments == | == Arguments == | ||
{{ | {{MC/Argument|be=1|trackName: string|basic_string}} | ||
: Specifies a music track to play. | : Specifies a music track to play. | ||
: {{ | : {{MC/Arg desc|be=basic_string}} | ||
: Must be a music track name (e.g. <code>record.cat</code>), or a music track defined under the Json path <code>"record.<music_name>"</code> or <code>"music.game.<music_name>"</code> in the <samp><a_resource_pack>/sounds/sound_definitions.json</samp> file (e.g. <code>cat</code> to play "Cat" music disc). | : Must be a music track name (e.g. <code>record.cat</code>), or a music track defined under the Json path <code>"record.<music_name>"</code> or <code>"music.game.<music_name>"</code> in the <samp><a_resource_pack>/sounds/sound_definitions.json</samp> file (e.g. <code>cat</code> to play "Cat" music disc). | ||
{{ | {{MC/Argument|be=1|volume: float|float}} | ||
: Specifies the volume of the music track. | : Specifies the volume of the music track. | ||
: {{ | : {{MC/Arg desc|be=float}} Should be between 0 and 1 (inclusive). | ||
{{ | {{MC/Argument|be=1|fadeSeconds: float|float}} | ||
: Specifies the duration the music track fades in/out. | : Specifies the duration the music track fades in/out. | ||
: {{ | : {{MC/Arg desc|be=float}} Should be between 0 and 10 (inclusive). | ||
{{ | {{MC/Argument|be=1|repeatMode: MusicRepeatMode|enum}} | ||
: Specifies whether the music track repeats or not. If unspecified, defaults to <code>play_once</code>. | : Specifies whether the music track repeats or not. If unspecified, defaults to <code>play_once</code>. | ||
: Must be one of <code>loop</code> and <code>play_once</code>. | : Must be one of <code>loop</code> and <code>play_once</code>. | ||
| Line 53: | Line 53: | ||
==Output== | ==Output== | ||
{{Output table|onlybe=1}} | {{MC/Output table|onlybe=1}} | ||
{{Output table|edition=be|On fail|0}} | {{MC/Output table|edition=be|On fail|0}} | ||
{{Output table|On success|1}} | {{MC/Output table|On success|1}} | ||
{{Output table}} | {{MC/Output table}} | ||
== Example == | == Example == | ||
| Line 67: | Line 67: | ||
== History == | == History == | ||
{{HistoryTable | {{HistoryTable | ||
|{{HistoryLine|bedrock}} | |{{MC/HistoryLine|bedrock}} | ||
|{{HistoryLine||1.16.100|dev=beta 1.16.100.58|Added {{ | |{{HistoryLine||1.16.100|dev=beta 1.16.100.58|Added {{MC/Cmd|music|link=none}}.}} | ||
}} | }} | ||
| Line 76: | Line 76: | ||
== Navigation == | == Navigation == | ||
{{Navbox commands}} | {{MC/Navbox commands}} | ||
de:Befehl/music | de:Befehl/music | ||
Latest revision as of 20:12, 9 April 2026
Script error: No such module "Exclusive". Template:Infobox command
Plays, queues, stops the music, or adjusts the music volume.
Syntax
music play <trackName: string> [volume: float] [fadeSeconds: float] [repeatMode: MusicRepeatMode]- Plays the music track.
music queue <trackName: string> [volume: float] [fadeSeconds: float] [repeatMode: MusicRepeatMode]- Adds the music track to the queue.
music stop [fadeSeconds: float]- Stops the music.
music volume <volume: float>- Adjusts the music volume.
Arguments
trackName: string: basic_string
- Specifies a music track to play.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|string}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}}
- Must be a music track name (e.g.
record.cat), or a music track defined under the Json path"record.<music_name>"or"music.game.<music_name>"in the <a_resource_pack>/sounds/sound_definitions.json file (e.g.catto play "Cat" music disc).
volume: float: float
- Specifies the volume of the music track.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} Should be between 0 and 1 (inclusive).
fadeSeconds: float: float
- Specifies the duration the music track fades in/out.
- {{#vardefine:onlyje|Template:IN,}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|float}}Template:Error{{#vardefine:onlyje|}}{{#vardefine:onlybe|}}{{#vardefine:je-arg|}}{{#vardefine:be-arg|}} Should be between 0 and 10 (inclusive).
repeatMode: MusicRepeatMode: enum
- Specifies whether the music track repeats or not. If unspecified, defaults to
play_once. - Must be one of
loopandplay_once.
Result
Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table Template:Result table
Output
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On fail}}{{#vardefine:output1-{{#var:output-table-lines}}|0}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-editions-num|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-{{#var:output-editions-num}}|be}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|1}} {{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:situation-{{#var:output-table-lines}}|On success}}{{#vardefine:output1-{{#var:output-table-lines}}|1}}{{#vardefine:output2-{{#var:output-table-lines}}|N/A}}{{#vardefine:output3-{{#var:output-table-lines}}|N/A}}{{#vardefine:command-row-{{#var:commands-num}}|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-edition-row-{{#var:output-editions-num}}|Expression error: Unrecognized punctuation character "{".}}
{{#vardefine:output-table-lines|Expression error: Unrecognized punctuation character "{".}}{{#vardefine:output-table-lines|-2}}{{#vardefine:output-table-lines-now|}}{{#vardefine:command-num-now|}}{{#vardefine:command-line-now|}}{{#vardefine:commands-num|}}{{#vardefine:output-edition-num-now|}}{{#vardefine:output-edition-line-now|}}{{#vardefine:output-editions-num|}}{{#vardefine:je-outputs-dis|}}
Example
Play the Pigstep music disc on repeat.
/music play record.pigstep 0.5 0 loop
Queue the Stal music disc.
/music queue record.stal 0.5 0 play_once
History
External links
de:Befehl/music ja:コマンド/music lzh:令/music pt:Comandos/music ru:Команды консоли/music zh:命令/music