{"record":{"id":"d87b4380fe658918","repo":"Anuken/Mindustry","slug":"no-parsers-for-content-type-type","errorCode":null,"errorMessage":"No parsers for content type '${type}'","messagePattern":"No parsers for content type '(.+?)'","errorType":"validation","errorClass":"SerializationException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":1038,"sourceCode":"     * @param file file that this content is being parsed from\n     * @return the content that was parsed\n     */\n    public Content parse(LoadedMod mod, String name, String json, Fi file, ContentType type) throws Exception{\n        checkInit();\n\n        //remove extra # characters to make it valid json... apparently some people have *unquoted* # characters in their json\n        if(file.extension().equals(\"json\")){\n            json = json.replace(\"#\", \"\\\\#\");\n        }\n\n        currentFile = file;\n        currentMod = mod;\n\n        var rawValue = parser.fromJson(null, Jval.read(json).toString(Jformat.plain));\n        if(!(rawValue instanceof JsonValue value)) throw new SerializationException(\"Content JSON must be an object, not a single value.\");\n\n        if(!parsers.containsKey(type)){\n            throw new SerializationException(\"No parsers for content type '\" + type + \"'\");\n        }\n\n        boolean located = allowPatching && locate(type, name) != null;\n        Content c = parsers.get(type).parse(mod.name, name, value);\n        c.minfo.sourceFile = file;\n        toBeParsed.add(c);\n\n        if(!located){\n            c.minfo.mod = mod;\n        }\n\n        currentMod = null;\n        currentFile = null;\n        return c;\n    }\n\n    public void checkInit(){\n        if(contentTypes.isEmpty()){","sourceCodeStart":1020,"sourceCodeEnd":1056,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L1020-L1056","documentation":"parse() checks parsers.containsKey(type) before dispatching. If the ContentType passed in has no registered TypeParser (i.e. that content category is not supported by ContentParser), it refuses to process the file rather than NPE on parsers.get(type).parse().","triggerScenarios":"A content file is placed under a directory whose ContentType is not registered in the parsers map (e.g. an unsupported or internal-only content type).","commonSituations":"Misnaming a content folder so it maps to an unexpected ContentType; targeting a Mindustry build where a content type is disabled; adding files for a type the parser doesn't handle.","solutions":["Place the file under the correct content subdirectory matching a registered type (blocks, units, items, liquids, etc.).","Confirm the ContentType enum value has a parser registered in this build.","Register a custom TypeParser in code if you extend content parsing."],"exampleFix":"// before: file under content/weathers/ where the type has no parser\n// after: move to a supported content type directory","handlingStrategy":"validation","validationCode":"if(!contentParser.parsers.containsKey(type)){\n    throw new IllegalStateException(\"No ContentParser registered for type \" + type);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Place files only under content directories that map to registered ContentTypes.","Register custom TypeParsers in code before loading custom content types."],"tags":["mindustry","modding","json","content-parser","unsupported-type"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}