Anuken/Mindustry · error · IllegalArgumentException
Unknown team:
Error message
Unknown team:
What it means
Thrown by the Team parser when data is a string but Structs.find over Team.baseTeams by name returns null. Only the built-in base teams can be matched by name; custom teams are not name-addressable this way.
Source
Thrown at core/src/mindustry/mod/ContentParser.java:389
});
put(Consume.class, (type, data) -> {
var oc = resolve(data.getString("type", ""), Consume.class);
data.remove("type");
var consume = make(oc);
readFields(consume, data);
return consume;
});
put(ConsumeLiquidBase.class, (type, data) -> {
var oc = resolve(data.getString("type", ""), ConsumeLiquidBase.class);
data.remove("type");
var consume = make(oc);
readFields(consume, data);
return consume;
});
put(Team.class, (type, data) -> {
if(data.isString()){
Team out = Structs.find(Team.baseTeams, t -> t.name.equals(data.asString()));
if(out == null) throw new IllegalArgumentException("Unknown team: " + data.asString());
return out;
}else if(data.isNumber()){
if(data.asInt() >= Team.all.length || data.asInt() < 0){
throw new IllegalArgumentException("Unknown team: " + data.asString());
}
return Team.get(data.asInt());
}else{
throw new IllegalArgumentException("Unknown team: " + data.asString() + ". Team must either be a string or a number.");
}
});
}};
/** Stores things that need to be parsed fully, e.g. reading fields of content.
* This is done to accommodate binding of content names first.*/
private Seq<Runnable> reads = new Seq<>();
private Seq<Runnable> postreads = new Seq<>();
private ObjectSet<Object> toBeParsed = new ObjectSet<>();
@Nullable LoadedMod currentMod;View on GitHub (pinned to f695ad7e60)
Solutions
- Use a valid base team name string (e.g. sharded, crux, malig, derelict, green, blue).
- For custom teams, use the numeric team ID instead of a name.
Example fix
// before "team": "shardedd" // after "team": "sharded"
Defensive patterns
Strategy: validation
Validate before calling
// Verify a base team name is valid before referencing.
boolean baseTeamExists(String name) {
return Structs.find(Team.baseTeams, t -> t.name.equals(name)) != null;
} Prevention
- Use exact base team name strings.
- Use numeric IDs for custom teams, not names.
- Keep the base team name list documented.
When it happens
Trigger: A mod JSON team field is a string that does not equal any base team's name (e.g. misspelled or a custom team name).
Common situations: Typo in a base team name, or attempting to reference a custom team by name (only numeric IDs work for those).
Related errors
- Unknown team: ${data.asString()}
- Unknown team: ${data.asString()}. Team must either be a stri
- Team field missing.
- Attribute definitions must be objects, e.g. {heat: 10}
- Unknown status effect: '
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/5ec5d1884afd10d9.
Report an issue: GitHub.