{"record":{"id":"ea9c2972b8243c33","repo":"Anuken/Mindustry","slug":"jsondata-name-null-jsondata-nam","errorCode":null,"errorMessage":"${jsonData.name == null ? \"\" : \"\\\"\" + jsonData.name + \"\\\": \"}No ${ctype} found with name '${jsonData.asString()}'.\nMake sure '${jsonData.asString()}' is spelled correctly, and that it really exists!\nThis may also occur because its file failed to parse.","messagePattern":"(.+?)No (.+?) found with name '(.+?)'\\.\nMake sure '(.+?)' is spelled correctly, and that it really exists!\nThis may also occur because its file failed to parse\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":515,"sourceCode":"                if(type == UnlockableContent.class){\n                    for(ContentType c : typesToSearch){\n                        T found = (T)locate(c, jsonData.asString());\n                        if(found != null){\n                            return found;\n                        }\n                    }\n                    throw new IllegalArgumentException(\"\\\"\" + jsonData.name + \"\\\": No content found with name '\" + jsonData.asString() + \"'.\");\n                }\n\n                if(Content.class.isAssignableFrom(type)){\n                    ContentType ctype = contentTypes.getThrow(type, () -> new IllegalArgumentException(\"No content type for class: \" + type.getSimpleName()));\n                    String prefix = currentMod != null ? currentMod.name + \"-\" : \"\";\n                    T one = (T)Vars.content.getByName(ctype, prefix + jsonData.asString());\n                    if(one != null) return one;\n                    T two = (T)Vars.content.getByName(ctype, jsonData.asString());\n\n                    if(two != null) return two;\n                    throw new IllegalArgumentException((jsonData.name == null ? \"\" : \"\\\"\" + jsonData.name + \"\\\": \") + \"No \" + ctype + \" found with name '\" + jsonData.asString() + \"'.\\nMake sure '\" + jsonData.asString() + \"' is spelled correctly, and that it really exists!\\nThis may also occur because its file failed to parse.\");\n                }\n            }\n\n            return super.readValue(type, elementType, jsonData, keyType);\n        }\n    };\n\n    public void readBlockConsumers(Block block, JsonValue value){\n        for(JsonValue child : value){\n            switch(child.name){\n                case \"remove\" -> {\n                    String[] values = child.isString() ? new String[]{child.asString()} : child.asStringArray();\n                    for(String type : values){\n                        if(type.equals(\"all\")){\n                            block.removeConsumers(b -> true);\n                        }else{\n                            Class<?> consumeType = resolve(\"Consume\" + Strings.capitalize(type), Consume.class);\n                            if(consumeType != Consume.class){","sourceCodeStart":497,"sourceCodeEnd":533,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L497-L533","documentation":"Thrown when the target type is a specific Content subclass: the parser looks up by mod-prefixed name then bare name, and if neither exists it rejects with the content type, the name, and a note that the file may have failed to parse.","triggerScenarios":"A mod JSON references content of a concrete type (item/block/unit/etc.) by a name not found in that type's registry, with or without the current mod's prefix.","commonSituations":"Misspelled name, mod-name prefix mismatch, referenced content whose own JSON failed to parse, or load-order problems with dependencies.","solutions":["Check spelling of the referenced name exactly as registered.","Verify the referenced content's file parsed successfully (earlier errors block later lookups).","Account for the mod-name prefix: cross-mod references may need the owning mod's prefix."],"exampleFix":"// before\n\"liquid\": \"water2\"\n// after\n\"liquid\": \"water\"","handlingStrategy":"validation","validationCode":"// Verify a typed content name exists (with and without the mod prefix).\nboolean contentExists(ContentType ctype, String prefix, String name) {\n    return Vars.content.getByName(ctype, prefix + name) != null\n        || Vars.content.getByName(ctype, name) != null;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Match the referenced name's spelling exactly.","Account for the owning mod's name prefix for cross-mod references.","Ensure the referenced content's own file parsed successfully."],"tags":["modding","json","content-parser","content-lookup"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}