Config Datapack

Config List for Datapacks

338

Config Datapack

✅ 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 with changed values under `Config` or `Custom Options/Config` But the with changed values 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/add.json` ```json {"values":["example:setup_config"]} ``` `data/example/function/setup_config.mcfunction` ```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` ```json {"values":["example:config"]} ``` `data/example/dialog/config.json` ```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

ADS