{"record":{"id":"c61bc292fb6a9ca6","repo":"HMCL-dev/HMCL","slug":"cannot-recognize-the-game-version-of-modpack","errorCode":null,"errorMessage":"Cannot recognize the game version of modpack ","messagePattern":"Cannot recognize the game version of modpack ","errorType":"exception","errorClass":"JsonParseException","httpStatus":null,"severity":"error","filePath":"HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLModpackProvider.java","lineNumber":70,"sourceCode":"        if (!(modpack.getManifest() instanceof HMCLModpackManifest))\n            throw new MismatchedModpackTypeException(getName(), modpack.getManifest().getProvider().getName());\n\n        if (!(dependencyManager.getGameRepository() instanceof HMCLGameRepository repository)) {\n            throw new IllegalArgumentException(\"HMCLModpackProvider requires HMCLGameRepository\");\n        }\n\n        return new ModpackUpdateTask(instance, new HMCLModpackInstallTask(repository, zipFile, modpack, instance));\n    }\n\n    @Override\n    public Modpack readManifest(ZipArchiveReader file, Path path, Charset encoding) throws IOException, JsonParseException {\n        String manifestJson = CompressingUtils.readTextZipEntry(file, \"modpack.json\");\n        Modpack manifest = JsonUtils.fromNonNullJson(manifestJson, HMCLModpack.class).setEncoding(encoding);\n        String gameJson = CompressingUtils.readTextZipEntry(file, \"minecraft/pack.json\");\n        GameInstanceManifest game = JsonUtils.fromNonNullJson(gameJson, GameInstanceManifest.class);\n        if (game.jar() == null)\n            if (StringUtils.isBlank(manifest.getVersion()))\n                throw new JsonParseException(\"Cannot recognize the game version of modpack \" + file + \".\");\n            else\n                manifest.setManifest(HMCLModpackManifest.INSTANCE);\n        else\n            manifest.setManifest(HMCLModpackManifest.INSTANCE).setGameVersion(game.jar().id());\n        return manifest;\n    }\n\n    private final static class HMCLModpack extends Modpack {\n        @Override\n        public Task<?> getInstallTask(DefaultDependencyManager dependencyManager, Path zipFile, GameInstanceID instanceId, String iconUrl) {\n            return new HMCLModpackInstallTask((HMCLGameRepository) dependencyManager.getGameRepository(), zipFile, this, instanceId);\n        }\n    }\n\n}\n","sourceCodeStart":52,"sourceCodeEnd":86,"githubUrl":"https://github.com/HMCL-dev/HMCL/blob/24702dc5a0214034f4c27166d5fd30cad08cec19/HMCL/src/main/java/org/jackhuang/hmcl/game/HMCLModpackProvider.java#L52-L86","documentation":"Thrown from McbbsModpackProvider.readManifest when the opened modpack ZIP contains neither mcbbs.packmeta nor manifest.json at its root. An Mcbbs modpack is identified by one of these entries, so their absence means the archive is not a recognizable Mcbbs pack.","triggerScenarios":"Importing a ZIP that lacks both root entries — e.g. a CurseForge pack (manifest.json inside a different structure or zipped under a folder), a server pack, or a mod ZIP mistaken for a modpack.","commonSituations":"Users selecting the wrong file (a mod or resource pack instead of a modpack); modpack zipped with an extra top-level directory so entries aren't at root; non-Mcbbs formats (CurseForge/Modrinth) fed to the Mcbbs importer.","solutions":["Verify the archive contains mcbbs.packmeta or manifest.json at its ROOT (entries must not be nested under a folder)","Use the correct importer for the format (CurseForge/Modrinth providers for those packs)","Re-zip so manifest files sit at the archive root (cd into the pack folder before zipping)","Re-download the modpack from its original source"],"exampleFix":"// before: zip layout\nmy-pack/manifest.json\n// after: zip layout (root)\nmanifest.json","handlingStrategy":"validation","validationCode":"try (ZipFile zip = new ZipFile(packFile)) {\n    if (zip.getEntry(\"mcbbs.packmeta\") == null && zip.getEntry(\"manifest.json\") == null)\n        throw new IllegalArgumentException(\"Not an Mcbbs modpack zip\");\n}","typeGuard":null,"tryCatchPattern":"try { provider.readManifest(stream, UTF_8); } catch (IOException e) { if (e.getMessage().contains(\"cannot be found\")) { /* tell user to pick a real mcbbs pack */ } else throw e; }","preventionTips":["Check archive root entries before import","Zip from inside the pack directory, not the parent","Use format auto-detection instead of forcing the Mcbbs provider"],"tags":["modpack","zip","manifest-not-found"],"backgroundTag":"file-not-found","analyzedSha":"24702dc5a0214034f4c27166d5fd30cad08cec19","analyzedAt":"2026-09-10T12:36:46.680Z","contentChangedAt":"2026-09-10T12:36:46.680Z","schemaVersion":2},"datasetVersion":"2026-09-15T23:17:13.987Z"}