{"record":{"id":"8bb5df7001e50414","repo":"Anuken/Mindustry","slug":"unknown-unit-command-name","errorCode":null,"errorMessage":"Unknown unit command name: ","messagePattern":"Unknown unit command name: ","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":161,"sourceCode":"        });\n        put(StatusEffect.class, (type, data) -> {\n            if(data.isString()){\n                StatusEffect result = locate(ContentType.status, data.asString());\n                if(result != null) return result;\n                throw new IllegalArgumentException(\"Unknown status effect: '\" + data.asString() + \"'\");\n            }\n            StatusEffect effect = new StatusEffect((currentMod == null ? null : currentMod.name + \"-\") + data.getString(\"name\"));\n            effect.minfo.mod = currentMod;\n            readFields(effect, data);\n            return effect;\n        });\n        put(UnitCommand.class, (type, data) -> {\n            if(data.isString()){\n               var cmd = content.unitCommand(data.asString());\n               if(cmd != null){\n                   return cmd;\n               }else{\n                   throw new IllegalArgumentException(\"Unknown unit command name: \" + data.asString());\n               }\n            }else{\n                throw new IllegalArgumentException(\"Unit commands must be strings.\");\n            }\n        });\n        put(UnitStance.class, (type, data) -> {\n            if(data.isString()){\n                var cmd = content.unitStance(data.asString());\n                if(cmd != null){\n                    return cmd;\n                }else{\n                    throw new IllegalArgumentException(\"Unknown unit stance name: \" + data.asString());\n                }\n            }else{\n                throw new IllegalArgumentException(\"Unit stances must be strings.\");\n            }\n        });\n        put(BulletType.class, (type, data) -> {","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L143-L179","documentation":"Thrown by the UnitCommand parser when data is a string but content.unitCommand(name) returns null, i.e. no command with that name is registered. Commands are referenced by name wherever a unit/command config uses a string.","triggerScenarios":"A mod JSON references a unit command by a string name that does not exist in the command registry.","commonSituations":"Typo in the command name, command added in a different game version, or referencing a command from a not-yet-loaded mod.","solutions":["Verify the exact command name against the registered unit commands.","Confirm the running game version supports that command.","Check load order if the command comes from another mod."],"exampleFix":"// before\n\"command\": \"moveto\"\n// after\n\"command\": \"moveTo\"","handlingStrategy":"validation","validationCode":"// Verify a unit command name is registered.\nboolean commandExists(String name) {\n    return Vars.content.unitCommand(name) != null;\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm the command exists in the target game version.","Keep command names case-correct.","Check mod load order for cross-mod commands."],"tags":["modding","json","content-parser","unit-command"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}