- 版权类型
- 原创
- 插件中文名称
- 配置读取
- 插件英文名称
- ConfigEase
- 原帖地址
- #
- 支持的核心(服务端)
- Spigot
- Paper
- Purpur
- PufferFish
- Leaves
- 其他核心
- 语言支持
- 多语言
- 前置组件
- PlaceholderAPI
- 适配版本(Java)
- 1.21
- 1.20
- 1.19
- 1.18
插件简介
- 使用变量读取其他插件的 yml 或 json 配置文件,实现灵活的数据展示。
- 支持多层级路径读取,json 数组索引读取。
- 如果在使用中遇到问题,可以加入官方群 1104261361 进行反馈。
使用案例
基本格式%<标识符>_<插件名>_<配置文件>_<路径...>%<标识符>:yamlConfig或jsonConfig<插件名>:插件配置文件夹名(位于plugins/下)<配置文件>:配置文件名,如config.yml或data.json<路径>:配置中要读取的字段路径,支持嵌套路径(通过.分隔)
YAML 示例
配置文件plugins/Essentials/config.yml
YAML:
spawn:
world: "world"
location:
x: 100
y: 64
z: 200
welcome_message: "欢迎玩家!"
代码:
%yamlConfig_Essentials_config.yml_spawn.world% → world
%yamlConfig_Essentials_config.yml_spawn.location.x% → 100
%yamlConfig_Essentials_config.yml_welcome_message% → 欢迎玩家!
JSON 示例
配置文件plugins/test/data.json
JSON:
{
"users": {
"1234": {
"name": "Pudding",
"score": 99
}
},
"settings": {
"motd_message": "欢迎!",
"features": ["a", "b", "c"]
}
}
代码:
%jsonConfig_test_data.json_users.1234.name% → Pudding
%jsonConfig_test_data.json_settings.motd_message% → 欢迎!
%jsonConfig_test_data.json_settings.features.1% → b
配置文件
YAML:
# Default root directory where plugin config files are located
default_path: "plugins"
# Error messages shown when placeholder evaluation fails
messages:
invalid_format: "Invalid Format"
file_not_found: "File Not Found"
no_key: "No Key"
error: "Error"