跳到主要内容
 Warning: Beta Version
版本:Beta ⚠️(未翻译)

Value Placeholder Fact

A fact that is computed from a placeholder. This placeholder is evaluated when the fact is read and can return anything. The value will be computed based on the values specified.


此变量只能读取,不能写入。因此,它仅适用于标准。

How could this be used?

If you only want to run certain actions if the player is in creative mode. Or depending on the weather, change the dialogue of the NPC.

Fields

Comment

继承可选
用于记录此条件用途的注释。

Group

必填

Placeholder

必填占位符

Placeholder to parse (e.g. %player_gamemode%


可以使用来自 PlaceholderApi 的占位符。例如,您可以使用 %player_name% 来表示玩家名称。

Values

必填正则表达式

The values to match the placeholder with and their corresponding fact value.

An example would be:

values:
SURVIVAL: 0
CREATIVE: 1
ADVENTURE: 2
SPECTATOR: 3

If the placeholder returns CREATIVE, the fact value will be 1. If no value matches, the fact value will be 0.

Values can have placeholders inside them.


可以使用 正则表达式 来匹配模式。例如,^.*$ 将匹配任何字符串。