Anuken/Mindustry · error · RuntimeException

Chained PartProgress operations must be an array.

Error message

Chained PartProgress operations must be an array.

What it means

Thrown by the PartProgress parser when a `operations`/`ops` key is present but its value is not a JSON array. Chained operations must be a list of operation objects applied in sequence.

Source

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

            if(!data.has("type")){
                throw new RuntimeException("PartProgress object need a 'type' string field. Check the PartProgress class for a list of constants.");
            }

            PartProgress base = (PartProgress)field(PartProgress.class, data.getString("type"));

            JsonValue opval =
                data.has("operation") ? data.get("operation") :
                data.has("op") ? data.get("op") : null;

            //no singular operation, check for multi-operation
            if(opval == null){
                JsonValue opsVal =
                    data.has("operations") ? data.get("operations") :
                    data.has("ops") ? data.get("ops") : null;

                if(opsVal != null){
                    if(!opsVal.isArray()) throw new RuntimeException("Chained PartProgress operations must be an array.");
                    int i = 0;
                    while(true){
                        JsonValue val = opsVal.get(i);
                        if(val == null) break;
                        JsonValue op = val.has("operation") ? val.get("operation") :
                            val.has("op") ? val.get("op") : null;

                        base = parseProgressOp(base, op.asString(), val);
                        i++;
                    }
                }

                return base;
            }

            //this is the name of the method to call
            String op = opval.asString();

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Wrap chained operations in a JSON array of operation objects.
  2. If only one operation is needed, use the singular `operation` or `op` key instead.

Example fix

// before
{ "type": "heat", "operations": { "op": "mul", "by": 2 } }
// after
{ "type": "heat", "operations": [ { "op": "mul", "by": 2 } ] }
Defensive patterns

Strategy: type-guard

Type guard

// Guard: chained PartProgress operations must be a JSON array.
boolean validOps(JsonValue v) {
    return !v.has("operations") && !v.has("ops")
        || (v.has("operations") ? v.get("operations").isArray() : v.get("ops").isArray());
}

Prevention

When it happens

Trigger: A mod JSON writes `operations` (or `ops`) as a single object or scalar instead of an array of operation objects.

Common situations: Confusing the singular `operation`/`op` form (one op) with the plural `operations`/`ops` form (array).

Related errors


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