{"record":{"id":"529bdd25ff78494f","repo":"Anuken/Mindustry","slug":"team-field-missing","errorCode":null,"errorMessage":"Team field missing.","messagePattern":"Team field missing\\.","errorType":"validation","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":869,"sourceCode":"                        Log.err(e);\n                    }\n                };\n            }\n\n            //always one sector right now...\n            planet.sectors.add(new Sector(planet, Ptile.empty));\n\n            currentContent = planet;\n            read(() -> readFields(planet, value));\n            return planet;\n        },\n        ContentType.team, (TypeParser<TeamEntry>)(mod, name, value) -> {\n            TeamEntry entry;\n            Team team;\n            if(value.has(\"team\")){\n                team = (Team)classParsers.get(Team.class).parse(Team.class, value.get(\"team\"));\n            }else{\n                throw new RuntimeException(\"Team field missing.\");\n            }\n            value.remove(\"team\");\n\n            if(allowPatching && locate(ContentType.team, name) != null){\n                entry = locate(ContentType.team, name);\n                readBundle(ContentType.team, name, value);\n            }else{\n                readBundle(ContentType.team, name, value);\n                entry = new TeamEntry(mod + \"-\" + name, team);\n            }\n            currentContent = entry;\n            read(() -> readFields(entry, value));\n            return entry;\n        }\n    );\n\n    Prov<Unit> unitType(JsonValue value){\n        if(value == null) return UnitEntity::create;","sourceCodeStart":851,"sourceCodeEnd":887,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L851-L887","documentation":"A team content entry MUST supply a \"team\" sub-object (parsed by the Team classParser) from which the actual Team reference is derived. Without it, there is no Team to bind the TeamEntry to, so the parser throws before constructing anything.","triggerScenarios":"A team JSON omits the \"team\" key entirely. The guard is the else branch of value.has(\"team\").","commonSituations":"New team entries missing the required nested team config; misnaming the key (e.g. \"teamId\").","solutions":["Add a \"team\" object to the team JSON (it carries team properties like color, name).","Confirm the key is literally \"team\"."],"exampleFix":"// before\n{ \"name\": \"crimson\" }\n// after\n{ \"team\": { \"name\": \"crimson\", \"color\": \"ff3333\" } }","handlingStrategy":"validation","validationCode":"if(!value.has(\"team\")){\n    throw new IllegalStateException(\"team content entry requires a 'team' object\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Always nest the team definition under the \"team\" key.","Match the key name exactly."],"tags":["mindustry","modding","json","content-parser","team","missing-field"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}