Anuken/Mindustry · error · IllegalArgumentException

"${jsonData.name}": No content found with name '${jsonData.a

Error message

"${jsonData.name}": No content found with name '${jsonData.asString()}'.

What it means

Thrown when the target type is UnlockableContent and the parser searches every content type in typesToSearch by name but finds nothing. The message includes the enclosing JSON field name to help locate the bad reference.

Source

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

                    }else if(type == ConsumeLiquid.class){
                        return (T)fromJson(ConsumeLiquid.class, "{liquid: " + split[0] + ", amount: " + split[1] + "}");
                    }
                }

                //try to parse Rect as array
                if(type == Rect.class && jsonData.isArray() && jsonData.size == 4){
                    return (T)new Rect(jsonData.get(0).asFloat(), jsonData.get(1).asFloat(), jsonData.get(2).asFloat(), jsonData.get(3).asFloat());
                }

                //search across different content types to find one by name
                if(type == UnlockableContent.class){
                    for(ContentType c : typesToSearch){
                        T found = (T)locate(c, jsonData.asString());
                        if(found != null){
                            return found;
                        }
                    }
                    throw new IllegalArgumentException("\"" + jsonData.name + "\": No content found with name '" + jsonData.asString() + "'.");
                }

                if(Content.class.isAssignableFrom(type)){
                    ContentType ctype = contentTypes.getThrow(type, () -> new IllegalArgumentException("No content type for class: " + type.getSimpleName()));
                    String prefix = currentMod != null ? currentMod.name + "-" : "";
                    T one = (T)Vars.content.getByName(ctype, prefix + jsonData.asString());
                    if(one != null) return one;
                    T two = (T)Vars.content.getByName(ctype, jsonData.asString());

                    if(two != null) return two;
                    throw new IllegalArgumentException((jsonData.name == null ? "" : "\"" + jsonData.name + "\": ") + "No " + ctype + " found with name '" + jsonData.asString() + "'.\nMake sure '" + jsonData.asString() + "' is spelled correctly, and that it really exists!\nThis may also occur because its file failed to parse.");
                }
            }

            return super.readValue(type, elementType, jsonData, keyType);
        }
    };

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Check the spelling of the referenced content name.
  2. Confirm the referenced content actually loaded (watch earlier parse errors in logs).
  3. Ensure dependency mods are present and load before this content.

Example fix

// before
"requirements": [ { "item": "coppor", "amount": 10 } ]
// after
"requirements": [ { "item": "copper", "amount": 10 } ]
Defensive patterns

Strategy: validation

Validate before calling

// Verify an UnlockableContent name exists across searchable content types.
boolean unlockableExists(String name) {
    for (ContentType t : ContentType.all) {
        if (Vars.content.getByName(t, name) != null) return true;
    }
    return false;
}

Prevention

When it happens

Trigger: A mod JSON field typed as UnlockableContent references a name not present in any searched content type (items, blocks, units, liquids, status effects, etc.).

Common situations: Misspelled content name, content that failed to parse earlier in the load, or a dependency mod not loaded.

Related errors


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