# 🅿️ 占位符

## 常见占位符

如果您想在其他插件中使用 PlaceholderAPI，只需将`%np_`替换为`%nameplates_`即可。 （例如`%nameplates_offset_30%` ）

如果这是嵌套占位符并且包含关系占位符，请在占位符之前添加`%rel_` 。 （例如`%rel_np_conditional_friend%` ）

如果这个占位符被所有玩家共享，你可以在占位符前添加`%shared_`以提高性能（例如 `%shared_customcrops_season_world%` ）

| 占位符                            | 值                                                                                                                                           |
| ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------- |
| %player\_name%                 | 玩家名称                                                                                                                                        |
| %player\_x%                    | x 坐标                                                                                                                                        |
| %player\_y%                    | y 坐标                                                                                                                                        |
| %player\_z%                    | z 坐标                                                                                                                                        |
| %player\_world%                | 世界名称                                                                                                                                        |
| %player\_remaining\_air%       | 剩余氧气                                                                                                                                        |
| %np\_offset\_\[-256\~256]%     | 生成偏移字符                                                                                                                                      |
| %np\_tag-image%                | 铭牌图像                                                                                                                                        |
| %np\_tag-text%                 | 铭牌文本                                                                                                                                        |
| %np\_tag%                      | 完整铭牌标签                                                                                                                                      |
| %np\_equipped\_nameplate%      | 装备的铭牌的id                                                                                                                                    |
| %np\_equipped\_nameplate-name% | 装备的铭牌的显示名称                                                                                                                                  |
| %np\_equipped\_bubble%         | 装备的气泡的id                                                                                                                                    |
| %np\_equipped\_bubble-name%    | 装备的气泡的显示名称                                                                                                                                  |
| %np\_is-latest%                | 检查插件是否是最新的                                                                                                                                  |
| %np\_gradient\_\[1\~20]%       | 基于速度生成渐变偏移数值（1\~20）                                                                                                                         |
| %np\_time\_12%                 | 12 小时制时间                                                                                                                                    |
| %np\_time\_24%                 | 24 小时制时间                                                                                                                                    |
| %np\_biome%                    | 生物群系的 ID                                                                                                                                    |
| %np\_actionbar%                | 来自其他插件或命令的动作栏消息                                                                                                                             |
| %np\_image\_\[id]%             | 在 CustomNameplates 中注册的图像                                                                                                                   |
| %np\_img\_\[id]%               | 原始图像字符                                                                                                                                      |
| %np\_is\_showing%              | 获取玩家是否使用切换命令显示标签（true/false）                                                                                                                |
| %np\_is\_previewing%           | 获取玩家是否正在预览标签（true/false）                                                                                                                    |
| %np\_conditional\_\[id]%       | [条件文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/tiao-jian-wen-ben)                      |
| %np\_background\_\[id]%        | [背景/铭牌/气泡文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/bei-jing-ming-pai-qi-pao-wen-ben) |
| %np\_nameplate\_\[id]%         | [背景/铭牌/气泡文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/bei-jing-ming-pai-qi-pao-wen-ben) |
| %np\_bubble\_\[id]%            | [背景/铭牌/气泡文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/bei-jing-ming-pai-qi-pao-wen-ben) |
| %np\_switch\_\[id]%            | [切换文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/qie-huan-wen-ben)                       |
| %np\_vanilla\_\[id]%           | [原版Hud](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/yuan-ban-hud)                          |
| %np\_static\_\[id]%            | [静态文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/jing-tai-wen-ben)                       |
| %np\_shift\_\[id]%             | [下降文本](https://momi.gtemc.cn/customnameplates/cha-jian-wiki/customnameplates/zi-ding-yi-zhan-wei-fu/xia-jiang-wen-ben)                      |

## 额外的占位符

额外的占位符是插件提供的附加变量。这些变量目前只有在安装了PlaceholderAPI之后才可用，它提供了一些有用的变量。

| 占位符                                                               | 值                                                                                                                                                                                                                                                                                          |
| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| %npex\_offset\_\[number]%                                         | 生成偏移字符                                                                                                                                                                                                                                                                                     |
| %npex\_lunarphase\_\[world]%                                      | 获取指定世界的月相                                                                                                                                                                                                                                                                                  |
| %npex\_lunarphase%                                                | 获取玩家所在世界的月相                                                                                                                                                                                                                                                                                |
| %npex\_weather\_\[world]%                                         | 获取指定世界的天气                                                                                                                                                                                                                                                                                  |
| %npex\_weather%                                                   | 获取玩家所在世界的天相                                                                                                                                                                                                                                                                                |
| %npex\_time12\_\[world]%                                          | 12 小时制时间                                                                                                                                                                                                                                                                                   |
| %npex\_time12%                                                    | 12 小时制时间                                                                                                                                                                                                                                                                                   |
| %npex\_time24\_\[world]%                                          | 24 小时制时间                                                                                                                                                                                                                                                                                   |
| %npex\_time24%                                                    | 24 小时制时间                                                                                                                                                                                                                                                                                   |
| %npex\_background\_\[id]:\[left-margin]:\[right-margin]:\[width]% | <p>根据给定的参数生成背景<br>示例: %npex\_background\_bedrock\_1:1:1:20%</p>                                                                                                                                                                                                                            |
| %npex\_newline%                                                   | 返回 \n                                                                                                                                                                                                                                                                                      |
| %npex\_smallfont\_\[placeholder/text]%                            | 文本以小字体显示                                                                                                                                                                                                                                                                                   |
|                                                                   | <div><figure><img src="https://3856066370-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fs87C1OsSEHzpv1XHzgIN%2Fuploads%2Fhz7AVYP9scNxHd6ld4Qe%2Fimage.png?alt=media&#x26;token=3f687dd9-14dd-4c4e-b808-2cabf9d59c55" alt=""><figcaption></figcaption></figure></div> |
| %npex\_static\_\[position]:\[value]:\[text]%                      | 创建一个静态文本(position = left,right,middle)                                                                                                                                                                                                                                                     |
