{"id":26787625,"url":"https://github.com/oroarmor/json-to-brigadier","last_synced_at":"2025-08-26T11:33:33.848Z","repository":{"id":49549777,"uuid":"373279888","full_name":"OroArmor/json-to-brigadier","owner":"OroArmor","description":"Allows JSON files to be converted into brigadier commands","archived":false,"fork":false,"pushed_at":"2021-06-15T01:14:03.000Z","size":104,"stargazers_count":7,"open_issues_count":1,"forks_count":2,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-19T20:59:14.275Z","etag":null,"topics":["brigadier","json","minecraft","minecraft-api"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OroArmor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-06-02T19:23:14.000Z","updated_at":"2025-03-08T19:59:43.000Z","dependencies_parsed_at":"2022-09-12T19:40:15.462Z","dependency_job_id":null,"html_url":"https://github.com/OroArmor/json-to-brigadier","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":"OroArmor/oro-mod-template","purl":"pkg:github/OroArmor/json-to-brigadier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OroArmor%2Fjson-to-brigadier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OroArmor%2Fjson-to-brigadier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OroArmor%2Fjson-to-brigadier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OroArmor%2Fjson-to-brigadier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OroArmor","download_url":"https://codeload.github.com/OroArmor/json-to-brigadier/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OroArmor%2Fjson-to-brigadier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272214419,"owners_count":24893201,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-26T02:00:07.904Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["brigadier","json","minecraft","minecraft-api"],"created_at":"2025-03-29T12:25:55.959Z","updated_at":"2025-08-26T11:33:33.831Z","avatar_url":"https://github.com/OroArmor.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Json To Brigadier \n\nThis library converts JSON files into a corresponding `ArgumentBuilder` that represents a command structure. This is meant to reduce the challenge of lining up hard to see parenthesis and chained commands in your code.\n\n## Usage\n\n### Inclusion\n\nAdd `mavenCentral()` to the repositories section of your `build.gradle`\n\nAdd the dependency via `implementation \"com.oroarmor:json-to-brigadier:1.0.0`\n\n### Code\n\nThe API has two main methods to use. `JsonToBrigadier.parse(Path)` and `JsonToBrigadier.parse(String)`. The first method takes in a path to the file, and then calls the second with the contents of that file. They both return an `ArgumentBuilder` object representing the command structure specified by the JSON string or file.\n\nThe method given in `executes` must have the signature `public static int`.\n\nExample:\n\n```json\n{\n  \"name\": \"test\",\n  \"argument\" : {\n    \"type\": \"brigadier:literal\"\n  },\n  \"children\": [\n    {\n      \"name\": \"value\",\n      \"argument\": {\n        \"type\": \"brigadier:integer\",\n        \"min\": 0,\n        \"max\": 1\n      },\n      \"executes\": \"com.example.TestSimpleCommand::runCommand\"\n    }\n  ]\n}\n```\n```java\nArgumentBuilder\u003cT, S\u003e builder = JsonToBrigadier.parse(json);\n```\n\nis the same as writing\n```java\nArgumentBuilder\u003cT, S\u003e builder = literal(\"test\")\n    .then(argument(\"value\", integer(0, 1))\n        .executes(TestSimpleCommand::runCommand));\n```\n\n### Supported Types\n\nThis library only supports the default argument types in Brigadier. For a library that supports Minecraft's arguments, look at \\\u003cTo be created\u003e.\n\nType | Name | Parameters | Example\n---- | ---- | ---------- | -------\nBoolean | `\"brigadier:boolean\"` | None | ```\"argument\": { \"type\": \"brigadier:boolean\"} ```\nFloat | `\"brigadier:float\"` | `min`, `max`. `min` is required for `max` | ```\"argument\": { \"type\": \"brigadier:float\", \"min\": 1} ```\nDouble | `\"brigadier:double\"` | `min`, `max`. `min` is required for `max` | ```\"argument\": { \"type\": \"brigadier:double\", \"min\": 0, \"max\": 100} ```\nLong | `\"brigadier:long\"` | `min`, `max`. `min` is required for `max` | ```\"argument\": { \"type\": \"brigadier:long\"} ```\nInteger | `\"brigadier:integer\"` | `min`, `max`. `min` is required for `max` | ```\"argument\": { \"type\": \"brigadier:integer\"} ```\nString | `\"brigadier:string\"` | `string_type`: `word`, `greedy`, `string`. Defaults to `string` | ```\"argument\": { \"type\": \"brigadier:string\"} ```\nLiteral | `\"brigadier:literal\"` | None | ```\"argument\": { \"type\": \"brigadier:literal\"} ```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foroarmor%2Fjson-to-brigadier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foroarmor%2Fjson-to-brigadier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foroarmor%2Fjson-to-brigadier/lists"}