/stopsound

/stopsound

原文:Commands/stopsound;源修订:3693867。

权限等级:Java 版为 2,基岩版为 1;基岩版需要开启作弊。停止指定声音。

语法

Java 版:

stopsound <targets> [<source>] [<sound>]

基岩版:

stopsound <player: target> [sound: string]

参数

targets(entity)或 player: target(CommandSelector<Player>):指定命令目标,可以是多名玩家。

Java 版的 <source>:指定声音在音乐和声音选项中所属的分类;* 表示所有分类。必须为 master、music、record、weather、block、hostile、neutral、player、ambient、voice 或 *。

sound(resource_location)或 sound: string(basic_string):指定要停止的声音。未指定时停止所有声音。基岩版应为 sound_definitions.json 中定义的声音事件,例如 mob.pig.say;Java 版应为 sounds.json 中定义的声音事件,例如 entity.pig.ambient。

结果

命令不完整或任意参数指定不正确时无法解析。基岩版目标选择器不是玩家类型,或目标不能解析为一个或多个在线玩家时失败。其他情况成功。

输出

Java 版失败时成功次数、success、result 均为 0;成功时成功次数、success 均为 1,result 为目标玩家数。基岩版失败时成功次数为 0,成功时为目标玩家数。

另见与外部链接

/playsound:播放声音。

Microsoft Learn:/stopsound 命令(2023 年 10 月 11 日)。

来源为 Minecraft Wiki;本中文翻译/改编按 CC BY-NC-SA 3.0 共享。