{"record":{"id":"ae1b16f7e79a5c69","repo":"HMCL-dev/HMCL","slug":"missing-modrinth-dependencies-minecraft","errorCode":null,"errorMessage":"missing Modrinth.dependencies.minecraft","messagePattern":"missing Modrinth\\.dependencies\\.minecraft","errorType":"validation","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthManifest.java","lineNumber":91,"sourceCode":"    }\n\n    public Map<String, String> getDependencies() {\n        return dependencies;\n    }\n\n    public String getGameVersion() {\n        return dependencies.get(\"minecraft\");\n    }\n\n    @Override\n    public ModpackProvider getProvider() {\n        return ModrinthModpackProvider.INSTANCE;\n    }\n\n    @Override\n    public void validate() throws JsonParseException, TolerableValidationException {\n        if (dependencies == null || dependencies.get(\"minecraft\") == null) {\n            throw new JsonParseException(\"missing Modrinth.dependencies.minecraft\");\n        }\n    }\n\n    public static class File {\n        private final String path;\n        private final Map<String, String> hashes;\n        @Nullable\n        private final Map<String, String> env;\n        private final List<String> downloads;\n        private final int fileSize;\n\n        public File(String path, Map<String, String> hashes, @Nullable Map<String, String> env, List<String> downloads, int fileSize) {\n            this.path = path;\n            this.hashes = hashes;\n            this.env = env;\n            this.downloads = downloads;\n            this.fileSize = fileSize;\n        }","sourceCodeStart":73,"sourceCodeEnd":109,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCLCore/src/main/java/org/jackhuang/hmcl/modpack/modrinth/ModrinthManifest.java#L73-L109","documentation":"Validation of a parsed ModrinthManifest fails because the dependencies object is missing or lacks the required 'minecraft' key. HMCL requires the target Minecraft version to construct the game instance and cannot proceed without it.","triggerScenarios":"Loading a modrinth.index.json whose dependencies object is absent, empty, or missing the minecraft entry (JsonUtils.parseModpackManifest / manifest.validate()).","commonSituations":"Hand-crafted or corrupted .mrpack files; manifests generated by tools that omit the minecraft dependency; truncated downloads.","solutions":["Add \"minecraft\": \"<version>\" to the dependencies object in modrinth.index.json and repackage the .mrpack","Re-download the modpack archive in case of corruption","Use a valid export from the Modrinth App or HMCL exporter that always includes the minecraft dependency"],"exampleFix":"// before\n\"dependencies\": { \"fabric-loader\": \"0.15.0\" }\n// after\n\"dependencies\": { \"minecraft\": \"1.20.1\", \"fabric-loader\": \"0.15.0\" }","handlingStrategy":"validation","validationCode":"if (manifest.getDependencies() == null || manifest.getDependencies().get(\"minecraft\") == null) throw new JsonParseException(\"missing Modrinth.dependencies.minecraft\");","typeGuard":null,"tryCatchPattern":"try { ModrinthManifest m = parse(...); m.validate(); } catch (JsonParseException e) { /* reject the pack with a clear message */ }","preventionTips":["Always include the minecraft dependency when authoring packs","Validate manifests with manifest.validate() before distributing","Re-download corrupted archives"],"tags":["modrinth","manifest","validation","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}