{"id":17691174,"url":"https://github.com/megyssstaa/rfmc","last_synced_at":"2026-04-28T11:32:50.973Z","repository":{"id":131062625,"uuid":"175020723","full_name":"MeGysssTaa/rfmc","owner":"MeGysssTaa","description":"Runtime Forge/FML mod controller — toggle mods without restarting","archived":false,"fork":false,"pushed_at":"2019-03-11T14:55:54.000Z","size":10,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-06T03:28:13.899Z","etag":null,"topics":["forge-mod","java","library","minecraft","minecraft-forge","minecraft-forge-mod","minecraft-modding","minecraftforge"],"latest_commit_sha":null,"homepage":null,"language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MeGysssTaa.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":"2019-03-11T14:44:19.000Z","updated_at":"2019-05-17T21:49:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"b7361366-ed33-402d-acb2-7ec7a6620418","html_url":"https://github.com/MeGysssTaa/rfmc","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeGysssTaa%2Frfmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeGysssTaa%2Frfmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeGysssTaa%2Frfmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MeGysssTaa%2Frfmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MeGysssTaa","download_url":"https://codeload.github.com/MeGysssTaa/rfmc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246386537,"owners_count":20768843,"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","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":["forge-mod","java","library","minecraft","minecraft-forge","minecraft-forge-mod","minecraft-modding","minecraftforge"],"created_at":"2024-10-24T12:07:44.938Z","updated_at":"2026-04-28T11:32:50.933Z","avatar_url":"https://github.com/MeGysssTaa.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RFMC\r\n## Runtime Forge Mod Control\r\n\r\nAn easy-to-use and lightweight library **(not a mod!)** that allows one to control Minecraft Forge/FML mods right at runtime. There is no proper API in Forge to do so, and thus RFMC uses nothing but black magic (reflections) to do its job.\r\n\r\n\r\n## Usage\r\nJust copy the `src/me/...` directory and clone it into your project's source folder. The only dependency is Forge. I personally used `1.8.9-11.15.1.2318`, but hope RFMC also works for other versions, or at least for the newer ones.\r\n\r\n\r\n**Done?** Now you can use code like this to control Forge mods:\r\n\r\n```java\r\nprivate static final String KEYSTROKES_MOD_ID = \"keystrokesmod\";\r\n\r\npublic void toogleKeystrokesMod() {\r\n    if (ModControl.isModEnabled(KEYSTROKES_MOD_ID)) {\r\n        // Since now, the mod will be displayed as disabled in the Forge mods list,\r\n        // and all its event handlers are unregistered.\r\n        System.out.println(\"The mod was enabled. Disabling it!\");\r\n        ModControl.disableMod(KEYSTROKES_MOD_ID);\r\n    } else {\r\n        // Since now, the mod will be displayed as enabled in the Forge mods list,\r\n        // and all its event handlers that were disabled previously are registered again.\r\n        System.out.println(\"The mod was disabled. Enabling it!\");\r\n        ModControl.enableMod(KEYSTROKES_MOD_ID);\r\n    }\r\n}\r\n```\r\n\r\n\r\nThe default implementation disables mods by switching their state to `DISABLED` and unregistering all their `MinecraftForge.EVENT_BUS` event handlers. The process of enabling simply does the opposite things, with new mod state being set to `AVAILABLE`.\r\n\r\n\r\nIf one or more of your mods require something more to be disabled, or are even courteous enough to provide some API for runtime control, you can always add mod-specific controllers as follows:\r\n```java\r\npublic class CustomModController implements ModController {\r\n    \r\n    public CustomModController() {\r\n        ModControl.registerModSpecificController(\"custom-mod-id\", this);\r\n    }\r\n    \r\n    public void enableMod() {\r\n        CustomModAPI.enableProperlyKThx();\r\n    }\r\n    \r\n    public void disableMod() {\r\n        CustomModAPI.disableProperlyKThx();\r\n    }\r\n    \r\n}\r\n```\r\n\r\nMod-specific controllers are called right before the basic implementation which was described above.\r\n\r\n\r\n### Contributing\r\nAny pull requests are always welcome, for example, if you want to add a publicly available mod-specific controller or do something else which may be cool for people using RFMC.\r\n\r\n\r\nIssues and bugs are not really welcome, obviously. However, if you believe something is wrong with the code and want me to fix it, please **open a proper issue** describing your problem in details.\r\n\r\n\r\nHave fun using RFMC!\r\n\r\n\r\n### License\r\nApache License 2.0\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegyssstaa%2Frfmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmegyssstaa%2Frfmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmegyssstaa%2Frfmc/lists"}