# 数值语法学习

**EcoX** 系列插件在数值选项时可以使用公式。

## 数值选项

在 **Yaml 语法学习** 一节中，我们已经介绍了大多数配置选项都是 `键: 值` 语法。当某个键的值只能是数字时，我们称之为数值选项。

大部分含有以下关键词字眼的选项都是数值选项：

* amount，例如 `amount: 1`。
* value，例如 `value: %level%`。

你也可以参考教程所给的示例配置，一般来说示例配置对应选项的值如果就是一个数字，那么往往就是数值选项。

## 公式

在数值选项中可以使用 `Placeholders` 的变量符，例如你可以制作根据玩家金币数量决定伤害的武器，同时涉及内部等级的（例如附魔等级、宠物等级、技能等级等），往往插件自带 `%level%` 变量符。

+：加号。例如 `1+2`。

-：减号。例如 `5-3`。

\*：乘号。

/：除号。

你可以使用 `( )` 符号来优先处理公式中的某个部分。例如在 `1 + 2 * 3` 中，根据常识很明显正确的计算步骤是先算乘法再算加法，但你可以使用 `(1 + 2) *3` 来实现先算加法，再算乘法。公式中不能使用中括号和大括号，你可以使用 `(( ))` 符号来实现中括号。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.superiormc.cn/ecox-doc/yi-ban-pei-zhi-ge-shi/shu-zhi-yu-fa-xue-xi.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
