{"record":{"id":"42c7cc45304810b8","repo":"Anuken/Mindustry","slug":"jsondata-name-no-content-found-with-name","errorCode":null,"errorMessage":"\"${jsonData.name}\": No content found with name '${jsonData.asString()}'.","messagePattern":"\"(.+?)\": No content found with name '(.+?)'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":504,"sourceCode":"                    }else if(type == ConsumeLiquid.class){\n                        return (T)fromJson(ConsumeLiquid.class, \"{liquid: \" + split[0] + \", amount: \" + split[1] + \"}\");\n                    }\n                }\n\n                //try to parse Rect as array\n                if(type == Rect.class && jsonData.isArray() && jsonData.size == 4){\n                    return (T)new Rect(jsonData.get(0).asFloat(), jsonData.get(1).asFloat(), jsonData.get(2).asFloat(), jsonData.get(3).asFloat());\n                }\n\n                //search across different content types to find one by name\n                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","sourceCodeStart":486,"sourceCodeEnd":522,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L486-L522","documentation":"Thrown when the target type is UnlockableContent and the parser searches every content type in typesToSearch by name but finds nothing. The message includes the enclosing JSON field name to help locate the bad reference.","triggerScenarios":"A mod JSON field typed as UnlockableContent references a name not present in any searched content type (items, blocks, units, liquids, status effects, etc.).","commonSituations":"Misspelled content name, content that failed to parse earlier in the load, or a dependency mod not loaded.","solutions":["Check the spelling of the referenced content name.","Confirm the referenced content actually loaded (watch earlier parse errors in logs).","Ensure dependency mods are present and load before this content."],"exampleFix":"// before\n\"requirements\": [ { \"item\": \"coppor\", \"amount\": 10 } ]\n// after\n\"requirements\": [ { \"item\": \"copper\", \"amount\": 10 } ]","handlingStrategy":"validation","validationCode":"// Verify an UnlockableContent name exists across searchable content types.\nboolean unlockableExists(String name) {\n    for (ContentType t : ContentType.all) {\n        if (Vars.content.getByName(t, name) != null) return true;\n    }\n    return false;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Reference content names exactly as registered.","Resolve load-order/dependency issues so referenced content loads first.","Watch earlier parse errors: a failed content file makes its name unresolvable later."],"tags":["modding","json","content-parser","content-lookup","unlockablecontent"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}