> For the complete documentation index, see [llms.txt](https://enchantedmobs.superiormc.cn/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://enchantedmobs.superiormc.cn/ultimatequest-zhong-wen-wen-dang/pei-zhi/actions/fundamentals.md).

# 文本与视觉动作

条目放在菜单按钮/内容动作节点，见[公共格式](/ultimatequest-zhong-wen-wen-dang/pei-zhi/actions.md)。

## `message`

向点击玩家发送聊天文本。

| 字段        | 默认值 | 说明    |
| --------- | --- | ----- |
| `message` | 必填  | 发送文案。 |

```yaml
type: message
message: '&aHello {player}.'
```

语言/文本变量取决于动作上下文。

## `action_bar`

在快捷栏上方显示文本。

| 字段        | 默认值 | 说明     |
| --------- | --- | ------ |
| `message` | 必填  | 快捷栏文案。 |

```yaml
type: action_bar
message: '&e{claimable} rewards ready.'
```

## `announcement`

向在线玩家广播聊天公告。

| 字段        | 默认值 | 说明    |
| --------- | --- | ----- |
| `message` | 必填  | 公告文案。 |

```yaml
type: announcement
message: '&e{player} is viewing quests.'
```

文本按执行玩家/上下文解析。

## `title`

显示标题和副标题。

| 字段           | 默认值 | 说明       |
| ------------ | --- | -------- |
| `main-title` | 必填  | 主标题。     |
| `sub-title`  | 必填  | 副标题。     |
| `fade-in`    | 必填  | 淡入 tick。 |
| `stay`       | 必填  | 停留 tick。 |
| `fade-out`   | 必填  | 淡出 tick。 |

```yaml
type: title
main-title: '&aQuests'
sub-title: '&7Choose a task'
fade-in: 10
stay: 40
fade-out: 10
```

所有时长字段都必填，包括取 0 时。

## `sound`

在玩家位置播放声音。

| 字段       | 默认值 | 说明      |
| -------- | --- | ------- |
| `sound`  | 必填  | 声音键/名称。 |
| `volume` | 1   | 音量。     |
| `pitch`  | 1   | 音调。     |

```yaml
type: sound
sound: minecraft:entity.player.levelup
volume: 1
pitch: 1
```

## `particle`

在玩家上方一格生成粒子。

| 字段                               | 默认值 | 说明                 |
| -------------------------------- | --- | ------------------ |
| `particle`                       | 必填  | 服务端粒子名。            |
| `count`                          | 必填  | 数量。                |
| `offset-x / offset-y / offset-z` | 必填  | 三个扩散分量。            |
| `speed`                          | 必填  | 粒子 extra/speed 参数。 |

```yaml
type: particle
particle: HAPPY_VILLAGER
count: 8
offset-x: 0.3
offset-y: 0.3
offset-z: 0.3
speed: 0
```

粒子名称及额外数据要求取决于服务端版本。

## `effect`

向玩家施加药水效果。

| 字段                           | 默认值  | 说明           |
| ---------------------------- | ---- | ------------ |
| `potion`                     | 必填   | 已注册药水效果键。    |
| `duration`                   | 必填   | 持续 tick。     |
| `level`                      | 必填   | 从 0 开始的放大等级。 |
| `ambient / particles / icon` | true | 显示开关。        |

```yaml
type: effect
potion: minecraft:speed
duration: 200
level: 0
particles: true
```

level: 0 表示 I 级。
