Config Datapack

数据包

· 作者 CJDev

数据包的配置列表

0 本站下载 0 关注 更新于 2 个月前

最新 1.2.2+mod · 26.3 · Fabric / Forge

一键开服(送7天)

✅ 特性

  • 通过 #config:list 添加配置列表对话框
  • 在 /trigger config 时调用 #config:add 以注册和自定义数据包配置

? 用法

你可以在 暂停界面 的 Config(配置)或 Custom Options/Config(自定义选项/配置)中找到它。
但推荐的方法是使用 /trigger config,它会显示已更改值的配置。

我真心希望 Mojang 能尽快为对话框中的动态初始值提供更好的方法 :p
否则我们很快就会遇到一些限制\

  • 使用函数命令进行保存的示例仅对服务器管理员有效 ;-; 请使用 Declarative UI 来克服这些限制
示例

data/config/tags/function/add.json

{"values":["example:setup_config"]}

data/example/function/setup_config.mcfunction

data modify storage config:list configs append value <config screen>
execute store result storage config:list configs[-1].inputs[0].initial int 1 run scoreboard players get @s exampleValue

data/config/tags/dialog/list.json

{"values":["example:config"]}

data/example/dialog/config.json

{
  "type": "minecraft:multi_action",
  "title": "Example Config",
  "inputs": [
    {
      "type": "minecraft:number_range",
      "key": "int",
      "label": "Int",
      "start": 0,
      "end": 100,
      "step": 1,
      "initial": 10
    },
    {
      "type": "minecraft:number_range",
      "key": "float",
      "label": "Float",
      "start": 0,
      "end": 100,
      "step": 0.1,
      "initial": 40
    },
    {
      "type": "minecraft:single_option",
      "key": "enum",
      "label": "Enum",
      "options": [
        "first",
        "second",
        "third"
      ]
    }
  ],
  "columns": 1,
  "actions": [
    {
      "label": "Save",
      "action": {
        "type": "dynamic/run_command",
        "template": "function example:config {int:$(int),float:$(float),enum:\"$(enum)\"}"
      }
    }
  ]
}

⚖️ 许可证

版本 <1.2 采用 ARR 许可证授权。 其他所有版本均采用 GNU GPL v3 许可证。

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

评论 0

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

登录后参与评分

还没有评论,来抢沙发吧

评论配图

相似资源