{"id":25267497,"url":"https://github.com/tetoe-mc/configx","last_synced_at":"2026-05-18T09:36:56.753Z","repository":{"id":274409661,"uuid":"922766746","full_name":"tetoe-mc/configx","owner":"tetoe-mc","description":"A fabric API library for plugins to load \u0026 save configurations","archived":false,"fork":false,"pushed_at":"2025-02-03T02:11:25.000Z","size":105,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-04-06T03:28:06.093Z","etag":null,"topics":["fabric","fabric-mc","minecraft","minecraft-library","server-plugin-library"],"latest_commit_sha":null,"homepage":"https://curseforge.com/minecraft/mc-mods/config-x","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tetoe-mc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-27T02:47:20.000Z","updated_at":"2025-02-08T02:38:26.000Z","dependencies_parsed_at":"2025-04-06T03:37:25.451Z","dependency_job_id":null,"html_url":"https://github.com/tetoe-mc/configx","commit_stats":null,"previous_names":["tetoe-mc/configx"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/tetoe-mc/configx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetoe-mc%2Fconfigx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetoe-mc%2Fconfigx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetoe-mc%2Fconfigx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetoe-mc%2Fconfigx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tetoe-mc","download_url":"https://codeload.github.com/tetoe-mc/configx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tetoe-mc%2Fconfigx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268918143,"owners_count":24328780,"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-05T02:00:12.334Z","response_time":2576,"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":["fabric","fabric-mc","minecraft","minecraft-library","server-plugin-library"],"created_at":"2025-02-12T09:38:21.514Z","updated_at":"2026-05-18T09:36:56.743Z","avatar_url":"https://github.com/tetoe-mc.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Config X\n\n[![Author](https://img.shields.io/badge/Author-NriotHrreion-red.svg \"Author\")](https://github.com/NriotHrreion)\n[![LICENSE](https://img.shields.io/badge/License-CC0_1.0-green.svg \"LICENSE\")](./LICENSE)\n[![Stars](https://img.shields.io/github/stars/tetoe-mc/configx.svg?label=Stars\u0026style=flat)](https://github.com/tetoe-mc/configx/stargazers)\n[![Github Workflow Status](https://img.shields.io/github/actions/workflow/status/tetoe-mc/configx/build.yml)](https://github.com/tetoe-mc/configx/actions/workflows/build.yml)\n\n## Description\n\nThis is a fabric API library for plugins to load \u0026 save configurations.\n\n## Installation\n\n1. Add the following to your build script:\n\n```gradle\nrepositories {\n    maven {\n        url = uri(\"https://repo.codemc.io/repository/tetoe-mc\")\n    }\n}\n\ndependencies {\n    // Approach #1: Ensure Config X is always available by including it within your own jar\n    include(modImplementation(\"space.nocp:configx:2.0.5\"))\n    \n    // Approach #2: Depend on Config X, but require that users install it themselves\n    modImplementation \"space.nocp:configx:2.0.5\"\n}\n```\n\n2. Refresh your project.\n\n## Usage\n\nRemember to import the package before starting.\n\n```java\nimport space.nocp.configx.api.*;\n```\n\n#### Register a configuration\n\nBefore registering a configuration, you need to write a class describing the configuration object and prepare a default configuration. Here, let's call the class `ConfigType`.\n\n```java\n// ...\nConfiguration config = ConfigManager.get().register(\"my-config\", defaultConfig, ConfigType.class);\n```\n\n#### Get a configuration\n\nAfter registering your configuration, you can use `config()` method to get the configuration at anywhere in your project.\n\n```java\nConfiguration config = ConfigManager.get().config(\"my-config\");\n```\n\n#### Get \u0026 set the configuration object\n\n```java\nConfiguration config = ...;\nConfigType configObj = config.get();\n\nconfigObj.myValue = \"Hello World\";\nconfig.set(configObj);\nconfig.save(); // Remember to save the config after setting it\n```\n\n#### Load the configuration from the file system manually\n\nUsually, the configuration is always up-to-date with the one storing in the file system. But sometimes, you may want to refresh it manually.\n\n```java\nConfiguration config = ...;\nconfig.load();\n```\n\n#### Get the info of the configuration\n\n```java\nConfiguration config = ...;\n\nString id = config.id; // my-config\nconfig.getFileName(); // my-config.json\nconfig.getPath().toString(); // C:/path/to/config/my-config.json\n```\n\n#### Use custom Gson to parse JSON\n\nConfig X stores your configuration in the JSON format. When you stores objects that requires custom serializers and deserializers, you need to build your own Gson to achieve this.\n\nBefore registering your configuration, you need to prepare your Gson in advance. Here, let's assume we already have a custom Gson object called `myGson`.\n\nJust simply add the Gson object as a parameter after all the parameters in `register()` method, and the parsing operations will be done with the provided Gson.\n\n```java\n// ...\nConfiguration config = ConfigManager.get().register(\"my-config\", defaultConfig, ConfigType.class, myGson);\n```\n\nFor more information about custom serializer and deserializer in Gson, see the article: [Building a Personalized Serializer and Deserializer using Java Gson Library](https://medium.com/@alexandre.therrien3/personalized-serializer-and-deserializer-using-java-gson-library-c079de3974d4)\n\n## Build from source\n\n```cmd\ngit clone https://github.com/tetoe-mc/configx.git\ncd configx\n./gradlew build\n```\n\nThen you can get the jar file in the build folder.\n\n## LICENSE\n\n[CC0 1.0](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetoe-mc%2Fconfigx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftetoe-mc%2Fconfigx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftetoe-mc%2Fconfigx/lists"}