PAPI - ConfigEase

插件

· 作者 PuddingKC

使用占位符从其他插件中读取配置值。

0 本站下载 0 关注 更新于 1 年前

最新 1.0.1 · 1.21.7 · Bukkit / Paper

一键开服(送7天)

ConfigEase 是一个 PlaceholderAPI 扩展,允许你通过占位符读取其他插件的 YAML 或 JSON 配置文件。
*安装时请将该插件放入 plugins 文件夹。

%<identifier>_<pluginName>_<configFile>_<path...>%

  • <identifier>:yamlConfig 或 jsonConfig
  • <pluginName>:/plugins 下的文件夹名称,即配置文件所在的插件目录
  • <configFile>:文件名(例如 config.yml 或 data.json)
  • <path>:配置文件内的键路径,使用 . 作为层级分隔符

YAML 示例

文件:plugins/Essentials/config.yml

spawn:
  world: "world"
  location:
    x: 100
    y: 64
    z: 200
welcome_message: "Welcome, player!"

占位符:

%yamlConfig_Essentials_config.yml_spawn.world% → world
%yamlConfig_essentials_config.yml_spawn.location.x% → 100
%yamlConfig_essentials_config.yml_welcome_message% → Welcome, player!

JSON 示例

文件:plugins/test/data.json

{
  "users": {
    "1234": {
      "name": "Pudding",
      "score": 99
    }
  },
  "settings": {
    "motd_message": "Welcome!",
    "features": ["a", "b", "c"]
  }
}

占位符:

%jsonConfig_test_data.json_users.1234.name% → Pudding
%jsonConfig_test_data.json_settings.motd_message% → Welcome!
%jsonConfig_test_data.json_settings.features.1% → b

配置

# 插件配置文件所在的默认根目录
default_path: "plugins"

# 当占位符求值失败时显示的错误消息
messages:
  invalid_format: "无效格式"
  file_not_found: "文件未找到"
  no_key: "无此键"
  error: "错误"

你是这个资源的作者?登录后可认领此资源。

评论 0

0.0
暂无评分
5 星
0
4 星
0
3 星
0
2 星
0
1 星
0
我的评分

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源