{"record":{"id":"183516b662700d4e","repo":"Anuken/Mindustry","slug":"unknown-objective-content","errorCode":null,"errorMessage":"Unknown objective content: ","messagePattern":"Unknown objective content: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":346,"sourceCode":"            var field = fieldOpt(Musics.class, data);\n\n            if(headless) return new Music(); //no reason to fetch on a server\n\n            //try grabbing it from the asset manager directly (relevant for data patches)\n            if(field == null) field = Core.assets.getOrNull(data.asString() + \".ogg\", Music.class);\n            if(field == null) field = Core.assets.getOrNull(data.asString() + \".mp3\", Music.class);\n            if(field == null) field = Core.assets.getOrNull(data.asString(), Music.class);\n\n            if(!allowAssetLoading && field == null){\n                warn(\"Music not found: @\", data.asString());\n                return new Music();\n            }\n            return field != null ? field : Vars.tree.loadMusic(data.asString());\n        });\n        put(Objectives.Objective.class, (type, data) -> {\n            if(data.isString()){\n                var cont = locateAny(data.asString());\n                if(cont == null) throw new IllegalArgumentException(\"Unknown objective content: \" + data.asString());\n                return new Research((UnlockableContent)cont);\n            }\n            var oc = resolve(data.getString(\"type\", \"\"), SectorComplete.class);\n            data.remove(\"type\");\n            Objectives.Objective obj = make(oc);\n            readFields(obj, data);\n            return obj;\n        });\n        put(Ability.class, (type, data) -> {\n            Class<? extends Ability> oc = resolve(data.getString(\"type\", \"\"));\n            data.remove(\"type\");\n            Ability obj = make(oc);\n            readFields(obj, data);\n            return obj;\n        });\n        put(Weapon.class, (type, data) -> {\n            var oc = resolve(data.getString(\"type\", \"\"), Weapon.class);\n            data.remove(\"type\");","sourceCodeStart":328,"sourceCodeEnd":364,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L328-L364","documentation":"Thrown by the Objective parser when data is a string but locateAny(name) returns null. A string objective is treated as a Research reference to an UnlockableContent; if no such content exists, it is rejected.","triggerScenarios":"A mod JSON defines an objective as a bare string referencing content that is not registered (e.g. research prerequisite pointing to a non-existent item/block).","commonSituations":"Typo in the content name, content defined in a mod that failed to parse, or referencing content that loads later.","solutions":["Verify the referenced content name exists and is spelled correctly.","Ensure the referenced content's file parsed without errors and loads before this objective resolves.","If you meant a sector-complete objective, use the object form with type: SectorComplete instead of a string."],"exampleFix":"// before\n\"objectives\": [ \"copper\" ]\n// after\n\"objectives\": [ \"copper\" ]   // valid only if 'copper' exists; otherwise fix spelling/type","handlingStrategy":"validation","validationCode":"// Verify referenced content exists across all types before using as an objective.\nboolean objectiveContentExists(String name) {\n    return locateAny(name) != null; // mirror ContentParser.locateAny\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the referenced content name is registered and spelled correctly.","Ensure referenced content loads (and parses) before objectives resolve.","Use the object form with type: SectorComplete when a sector objective is intended."],"tags":["modding","json","content-parser","objectives","research"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}