Config Datapack

Config Datapack

Mod and data pack

Config List for Datapacks

Server Utility

51 downloads
0 followers
Follow Save

✅ Features

  • Adds a config list dialog via #config:list
  • Calls #config:add on /trigger config to register and customize datapack configs

📖 Usage

You can find it in the Pause Screen under Config or Custom Options/Config
But the preferred method is using /trigger config, which shows you the Configs with changed values

I sure hope Mojang adds better methods for dynamic initial values in dialogs soon :p
else we'll hit some limits soon
+ the example using the function command for saving only works for server admins ;-;

Example

data/config/tags/function/show.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)\"}"
      }
    }
  ]
}

⚖️ License

Versions <1.2 are licensed under the ARR license. Every other under GNU GPL v3


Project members

CJDev

Member

Details

Licensed GPL-3.0-only
Published a month ago
Updated 2 months ago