Anuken/Mindustry · error · SerializationException

No parsers for content type '${type}'

Error message

No parsers for content type '${type}'

What it means

parse() checks parsers.containsKey(type) before dispatching. If the ContentType passed in has no registered TypeParser (i.e. that content category is not supported by ContentParser), it refuses to process the file rather than NPE on parsers.get(type).parse().

Source

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

     * @param file file that this content is being parsed from
     * @return the content that was parsed
     */
    public Content parse(LoadedMod mod, String name, String json, Fi file, ContentType type) throws Exception{
        checkInit();

        //remove extra # characters to make it valid json... apparently some people have *unquoted* # characters in their json
        if(file.extension().equals("json")){
            json = json.replace("#", "\\#");
        }

        currentFile = file;
        currentMod = mod;

        var rawValue = parser.fromJson(null, Jval.read(json).toString(Jformat.plain));
        if(!(rawValue instanceof JsonValue value)) throw new SerializationException("Content JSON must be an object, not a single value.");

        if(!parsers.containsKey(type)){
            throw new SerializationException("No parsers for content type '" + type + "'");
        }

        boolean located = allowPatching && locate(type, name) != null;
        Content c = parsers.get(type).parse(mod.name, name, value);
        c.minfo.sourceFile = file;
        toBeParsed.add(c);

        if(!located){
            c.minfo.mod = mod;
        }

        currentMod = null;
        currentFile = null;
        return c;
    }

    public void checkInit(){
        if(contentTypes.isEmpty()){

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Place the file under the correct content subdirectory matching a registered type (blocks, units, items, liquids, etc.).
  2. Confirm the ContentType enum value has a parser registered in this build.
  3. Register a custom TypeParser in code if you extend content parsing.

Example fix

// before: file under content/weathers/ where the type has no parser
// after: move to a supported content type directory
Defensive patterns

Strategy: validation

Validate before calling

if(!contentParser.parsers.containsKey(type)){
    throw new IllegalStateException("No ContentParser registered for type " + type);
}

Prevention

When it happens

Trigger: A content file is placed under a directory whose ContentType is not registered in the parsers map (e.g. an unsupported or internal-only content type).

Common situations: Misnaming a content folder so it maps to an unexpected ContentType; targeting a Mindustry build where a content type is disabled; adding files for a type the parser doesn't handle.

Related errors


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