Anuken/Mindustry · error · RuntimeException

Team field missing.

Error message

Team field missing.

What it means

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.

Source

Thrown at core/src/mindustry/mod/ContentParser.java:869

                        Log.err(e);
                    }
                };
            }

            //always one sector right now...
            planet.sectors.add(new Sector(planet, Ptile.empty));

            currentContent = planet;
            read(() -> readFields(planet, value));
            return planet;
        },
        ContentType.team, (TypeParser<TeamEntry>)(mod, name, value) -> {
            TeamEntry entry;
            Team team;
            if(value.has("team")){
                team = (Team)classParsers.get(Team.class).parse(Team.class, value.get("team"));
            }else{
                throw new RuntimeException("Team field missing.");
            }
            value.remove("team");

            if(allowPatching && locate(ContentType.team, name) != null){
                entry = locate(ContentType.team, name);
                readBundle(ContentType.team, name, value);
            }else{
                readBundle(ContentType.team, name, value);
                entry = new TeamEntry(mod + "-" + name, team);
            }
            currentContent = entry;
            read(() -> readFields(entry, value));
            return entry;
        }
    );

    Prov<Unit> unitType(JsonValue value){
        if(value == null) return UnitEntity::create;

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Add a "team" object to the team JSON (it carries team properties like color, name).
  2. Confirm the key is literally "team".

Example fix

// before
{ "name": "crimson" }
// after
{ "team": { "name": "crimson", "color": "ff3333" } }
Defensive patterns

Strategy: validation

Validate before calling

if(!value.has("team")){
    throw new IllegalStateException("team content entry requires a 'team' object");
}

Prevention

When it happens

Trigger: A team JSON omits the "team" key entirely. The guard is the else branch of value.has("team").

Common situations: New team entries missing the required nested team config; misnaming the key (e.g. "teamId").

Related errors


AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14). Data as JSON: /api/errors/529bdd25ff78494f. Report an issue: GitHub.