这是本文档旧的修订版!
变量列表 Variables List
(版本:2017-08-21 原文链接)
玩家名字: `player`
此变量代表玩家的名字/ID。如果你使用了display
参数,此变量会使用玩家的显示名称(如Essentials定义的display name)而不是实际ID。
例如: %player.display%
NPC: `npc`
非常简单的变量。npc
会以玩家的语言被替换为NPC的显示名字。
例如: %npc%
任务目标属性: `objective`
你可以用此变量显示某个任务目标的流程/进度等等。第一个参数是objectives.yml中定义的任务目标的ID(不是任务目标列表中的任务目标本身)。请确保此玩家已启动了这个任务目标,否则这个变量将会显示空白(“”);第二个参数是这个任务目标的某个属性property
。每一种目标objective都有各种不同的任务属性property
可供利用,具体你可以参阅任务目标列表。
例子: %objective.kill_zombies.left:20%
积分: `point`
此变量显示这个玩家的某项积分,或还欠缺的积分。第一个参数是积分名称,第二个参数可以是amount
表示积分数值,或left:x
表示距离总分x还缺多少分。
例如: %point.reputation.left:15%
物品: `item`
With this variable you can display amount of specific items in player's inventory or a number needed to reach specific amount. The first argument is the name of an item (as defined in _items.yml_) and the second one is either `amount` or `left:x`, where `x` is a number.
Example: `%item.stick.amount%`
插件版本: `version`
此变量用于显示插件的版本。你还可以在后面加上插件的名称用来显示你想要的插件版本。
例如: %version.Citizens%
坐标: `location`
This variable resolves to player's current location, formatted as an absolute location format (more about it in the _Reference_ chapter). The location will contain yaw and pitch. You can use it instead of coordinates as location arguments in events, conditions and objectives.
Example: `%location%`