
命令
/title
在玩家屏幕上显示大标题、副标题或动作栏消息,并控制标题的停留时间。
| /title <targets> (actionbar <title>|subtitle <title>|title <title>) |
| /title <targets> (clear|reset) |
| /title <targets> times <fadeIn> <stay> <fadeOut> |
| 参数 | 值的类型 | 输入内容 |
|---|---|---|
| <targets> | 目标选择器 | 看到标题的玩家。任意数量的玩家,以选择器或玩家名称给出。一名或多名玩家。 |
| <title> | 文本组件 | 要显示的文本,为文本组件:带引号的字符串、花括号中的组件,或方括号中的组件列表。 |
| <fadeIn> | 时间 | 标题淡入需要多久,以刻为单位(20刻=1秒)。最小值为0。默认10。至少为0。 |
| <stay> | 时间 | 标题完全显示多久,以刻为单位。最小值为0。默认70。至少为0。 |
| <fadeOut> | 时间 | 标题淡出需要多久,以刻为单位。最小值为0。默认20。至少为0。 |
| 权限等级 | 2:管理员、开启作弊的世界、命令方块和函数 |
| 适用于 | 服务器管理员、在启用了作弊的单人或局域网世界中的玩家、服务器控制台、命令方块和函数。 |
| 结果 | 报告标题操作应用到了哪个玩家或多少名玩家。返回玩家数量。 |
| title | /title <targets> title <title>会立即在屏幕中央显示大号文字。 |
| subtitle | /title <targets> subtitle <title>会设置标题下方较小的一行文字。它不会单独出现,而是与标题一起显示;先发送副标题,再发送标题。 |
| actionbar | /title <targets> actionbar <title>会在快捷栏正上方显示文字,持续60tick(3秒)。 |
| times | /title <targets> times <fadeIn> <stay> <fadeOut>会设置标题淡入、停留和淡出的时长,单位为tick。默认值分别为10、70和20刻(0.5、3.5和1秒)。每个值还可以带单位:t表示刻,s表示秒,d表示游戏内的天。 最小值为0。这些时间对之后的标题仍然有效。 |
| clear | /title <targets> clear会从屏幕上移除标题和副标题。 |
| reset | /title <targets> reset会移除标题和副标题,并将时间恢复为默认的10、70和20tick。 |
| 文本组件形式 | 在26.3中,文本写作文本组件,例如{text:"Welcome",color:"gold",bold:true}。像“Welcome”这样的普通带引号字符串也可以。 |
/title @a title {text:"Welcome",color:"gold",bold:true}在每位玩家屏幕中央显示粗体金色的Welcome。
/title @a subtitle {text:"Good luck",color:"gray"}设置灰色副标题Good luck,将与下一个标题一同显示。
/title @p actionbar "Low on health"在最近玩家的快捷栏上方显示Low on health。
/title @a times 10 70 20将标题设为淡入10刻、停留70刻、淡出20刻。
/title @a times 1s 5s 1s将标题设为淡入1秒、停留5秒、淡出1秒。
/title @a clear从每个玩家的屏幕上移除标题。
/title @s reset移除你的标题并恢复默认的标题时间。



