Anuken/Mindustry · error · IllegalArgumentException
No ${type} found with name '${name}'
Error message
No ${type} found with name '${name}' What it means
find(ContentType, name) looks up content by exact name, then by currentMod-prefixed name (currentMod.name + "-" + name). If both fail, no content exists with that reference, so a downstream operation would NPE — the parser fails fast with a descriptive message instead.
Source
Thrown at core/src/mindustry/mod/ContentParser.java:918
};
}
private String getString(JsonValue value, String key){
if(value.has(key)){
return value.getString(key);
}else{
throw new IllegalArgumentException("You are missing a \"" + key + "\". It must be added before the file can be parsed.");
}
}
private String getType(JsonValue value){
return getString(value, "type");
}
private <T extends Content> T find(ContentType type, String name){
Content c = Vars.content.getByName(type, name);
if(c == null && currentMod != null) c = Vars.content.getByName(type, currentMod.name + "-" + name);
if(c == null) throw new IllegalArgumentException("No " + type + " found with name '" + name + "'");
return (T)c;
}
private <T extends Content> TypeParser<T> parser(ContentType type, Func<String, T> constructor){
return (mod, name, value) -> {
T item;
if(allowPatching && locate(type, name) != null){
item = (T)locate(type, name);
readBundle(type, name, value);
}else{
readBundle(type, name, value);
item = constructor.get(mod + "-" + name);
}
currentContent = item;
read(() -> readFields(item, value));
return item;
};
}View on GitHub (pinned to f695ad7e60)
Solutions
- Use the exact internal content name (e.g. "copper", not "Copper").
- Ensure the referenced content is loaded before the referencing file.
- Verify the content type matches (do not look up a liquid via ContentType.item).
Example fix
// before find(ContentType.item, "Copper") // after find(ContentType.item, "copper")
Defensive patterns
Strategy: validation
Validate before calling
// Verify content exists before referencing it.
Content c = Vars.content.getByName(type, name);
if(c == null && currentMod != null) c = Vars.content.getByName(type, currentMod.name + "-" + name);
if(c == null) throw new IllegalStateException("No " + type + " named '" + name + "' is registered"); Prevention
- Reference content by exact internal name and correct ContentType.
- Respect load order for cross-mod references.
When it happens
Trigger: Any JSON reference (consume item, requirement block, etc.) names content that is not registered: typo, wrong content type, or not-yet-loaded content.
Common situations: Referring to a vanilla item by display name instead of internal name; depending on content from a mod that loads later; using the wrong ContentType.
Related errors
- Planet '${value.getString("planet")}' not found.
- "${jsonData.name}": No content found with name '${jsonData.a
- ${jsonData.name == null ? "" : "\"" + jsonData.name + "\": "
- Unknown consumption type: '${child.name}' for block '${block
- Blocks cannot be larger than ${maxBlockSize}
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/38a7ef36bc244a97.
Report an issue: GitHub.