Minecraft Wiki

除另有声明,转载时均必须注明出处若簡繁轉換出錯,請以遊戲內為準请勇于扩充与修正内容有兴趣逛逛我们的微博沟通交流,欢迎到社区专页需要协助,请在告示板留言

了解更多

Minecraft Wiki
(机器人:自动替换文本 (-Category:命令 +{{Commands}}))
(机器人:源码整理:移除段落标题后多余空行)
(未显示9个用户的14个中间版本)
第1行: 第1行:
  +
{{Infobox command
{{:命令/infobox
 
|stopsound
+
|name=stopsound
  +
|oplevel=2{{only|java}}<br>1{{only|bedrock}}
|op
 
  +
|becheat=1
|1.9.3|1.9.3-pre2
 
|PE 1.0.5|PE 1.0.5 build 1
 
 
}}
 
}}
   
 
停止声音播放。
 
停止声音播放。
   
;语法
+
== 语法 ==
 
 
* '''Java版'''
 
* '''Java版'''
: <code>stopsound <''玩家''> [''来源''] [''声音'']</code>
+
: <code>stopsound <targets> [<source>] [<sound>]</code>
   
 
* '''基岩版'''
 
* '''基岩版'''
: <code>stopsound <''玩家:目标''> [''声音:字符串'']</code>
+
: <code>stopsound <player: target> [<sound: string>]</code>
   
;参数
+
== 参数 ==
  +
{{argument|targets|minecraft:entity|player: target|CommandSelector<Player>}}
  +
: 指定声音的接收者。
  +
: 必须是玩家名称或[[目标选择器]]。且目标选择器只允许选择玩家。
   
  +
{{el|je|short=1}}: {{literal|<''source''>}}
: ''玩家''(基岩版:''玩家:目标'')
 
  +
: 指定要停止的声音所属的类别,对应于游戏选项中“音乐和声音”设置的分类。
:: 指定声音的接收者。必须是玩家名称或[[#目标选择器|目标选择器]]。<!-- 1.8 note: cannot target non-players, even with @e -->
 
 
: 必须为以下之一:<code>master</code>、<code>music</code>、<code>record</code>、<code>weather</code>、<code>block</code>、<code>hostile</code>、<code>neutral</code>、<code>player</code>、<code>ambient</code>、<code>voice</code>或<code>*</code>。
   
  +
{{argument|sound|minecraft:resource_location|sound: string|basic_string}}
: ''来源''(可选){{only|java}}
 
  +
: 指定要停止的声音。若未指定,则停止所有声音。
:: 指定要停止的声音所属的类别,对应于游戏选项中“音乐和声音”设置的分类。必须为以下之一:<code>master</code>、<code>music</code>、<code>record</code>、<code>weather</code>、<code>block</code>、<code>hostile</code>、<code>neutral</code>、<code>player</code>、<code>ambient</code>、<code>voice</code>或<code>*</code>。
 
 
: {{in|java}}必须为在[[Sounds.json#声音事件|sounds.json]]中被定义的一个声音项目(例如,<code>mob.pig.say</code>)。
  +
: {{in|bedrock}}必须为在[[Sounds.json#基岩版数据值|sound_definitions.json]]中被定义的一个声音项目。
   
  +
== 结果 ==
: ''声音''(基岩版:''声音:字符串'')(可选)
 
  +
{{Result table}}
:: 指定要停止的声音。必须为在[[Sounds.json#声音事件|sounds.json]]中被定义的一个声音项目(例如,<code>mob.pig.say</code>)。若未指定,则停止所有声音
 
  +
{{Result table|参数不正确|unparseable|fail}}
  +
{{Result table|<code><targets></code> 或 <code>player: target</code> 无法解析为一个或多个在线玩家|fail}}
  +
{{Result table|succeed|停止指定玩家的指定声音}}
  +
{{Result table}}
   
  +
== 输出 ==
;效果
 
  +
{{Output table}}
  +
{{Output table|edition=je|执行失败|0|0|0}}
  +
{{Output table|执行成功|1|1|被选中的玩家数量}}
  +
{{Output table|edition=be|执行失败|0}}
  +
{{Output table|执行成功|被选中的玩家数量}}
  +
{{Output table}}
   
  +
== 历史 ==
: 若参数设置不正确,或''玩家''无法解析为一个或多个在线玩家时,命令失败。
 
  +
{{History|java}}
  +
{{History||1.9.3|snap=pre2|加入了{{cmd|stopsound|link=none}}。}}
  +
{{History|pocket}}
  +
{{History||1.0.5|snap=1.0.5.0|加入了{{cmd|stopsound|link=none}}。}}
  +
{{History|foot}}
   
  +
{{Commands}}
: 成功时,为指定玩家停止指定的声音播放。
 
   
{{Commands}}
+
[[en:Commands/stopsound]]
  +
[[de:Befehl/stopsound]]
  +
[[ru:Команды консоли/stopsound]]
  +
[[uk:Команди консолі/stopsound]]

2022年8月4日 (四) 15:59的版本

stopsound
需要的权限等级

2[仅Java版]
1[仅基岩版]

限制条件

启用作弊[仅基岩版]

停止声音播放。

语法

  • Java版
stopsound <targets> [<source>] [<sound>]
  • 基岩版
stopsound <player: target> [<sound: string>]

参数

JE<targets>minecraft:entity
BEplayer: targetCommandSelector<Player>

指定声音的接收者。
必须是玩家名称或目标选择器。且目标选择器只允许选择玩家。

JE: <source>

指定要停止的声音所属的类别,对应于游戏选项中“音乐和声音”设置的分类。
必须为以下之一:mastermusicrecordweatherblockhostileneutralplayerambientvoice*

JE<sound>minecraft:resource_location
BEsound: stringbasic_string

指定要停止的声音。若未指定,则停止所有声音。
Java版中,必须为在sounds.json中被定义的一个声音项目(例如,mob.pig.say)。
基岩版中,必须为在sound_definitions.json中被定义的一个声音项目。

结果

命令触发条件Java版基岩版
任意参数不正确 无法解析 执行失败
<targets>player: target 无法解析为一个或多个在线玩家 执行失败
执行成功时停止指定玩家的指定声音

输出

命令版本条件成功次数/execute store success .../execute store result ...
任意Java版执行失败000
执行成功11被选中的玩家数量
基岩版执行失败0N/AN/A
执行成功被选中的玩家数量N/AN/A

历史

Java版
1.9.3pre2加入了/stopsound
携带版
1.0.51.0.5.0加入了/stopsound