Anuken/Mindustry · error · IllegalArgumentException
Unknown team: ${data.asString()}. Team must either be a stri
Error message
Unknown team: ${data.asString()}. Team must either be a string or a number. What it means
Thrown by the Team parser when data is neither a string nor a number (e.g. an object, array, or boolean). Teams can only be addressed by base-team name or numeric ID.
Source
Thrown at core/src/mindustry/mod/ContentParser.java:397
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;
@Nullable Content currentContent;
@Nullable Fi currentFile;
private Json parser = new Json(){
@Override
protected <T> Class<T> resolveClass(String className){
if(allowClassResolution){
return super.resolveClass(className);View on GitHub (pinned to f695ad7e60)
Solutions
- Provide the team as a string base-team name.
- Or provide the team as a numeric ID.
Example fix
// before
"team": { "name": "crux" }
// after
"team": "crux" Defensive patterns
Strategy: type-guard
Type guard
// Guard: team value must be a string or number.
boolean isTeamRef(JsonValue v) { return v.isString() || v.isNumber(); } Prevention
- Provide team as a string name or numeric ID only.
- Do not wrap team values in objects.
- Lint JSON value types in mod files.
When it happens
Trigger: A mod JSON team field is an object or other non-scalar JSON value.
Common situations: Misformatted team value, e.g. wrapping the team in an object or passing a boolean.
Related errors
- Unknown team:
- Unknown team: ${data.asString()}
- 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/7b71dd530d8318c2.
Report an issue: GitHub.