Anuken/Mindustry · error · IllegalArgumentException
Unknown consumption type: '${child.name}' for block '${block
Error message
Unknown consumption type: '${child.name}' for block '${block.name}'. What it means
Thrown by readBlockConsumers() when a block's JSON 'consumes' object contains a child key that matches none of the recognized consumption categories (item, itemCharged, itemFlammable, itemRadioactive, itemExplosive, itemList, itemExplode, items, itemsBoost, liquidFlammable, liquid, liquids, coolant, liquidsBoost, power, powerBuffered). The switch's default branch fires, so the parser refuses to silently ignore an unknown requirement.
Source
Thrown at core/src/mindustry/mod/ContentParser.java:571
parser.readValue(ConsumeItems.class, child)).boost();
case "liquidFlammable" -> block.consume((Consume)parser.readValue(ConsumeLiquidFlammable.class, child));
case "liquid" -> block.consume((Consume)parser.readValue(ConsumeLiquid.class, child));
case "liquids" -> block.consume(
child.isArray() ? new ConsumeLiquids(parser.readValue(LiquidStack[].class, child)) :
parser.readValue(ConsumeLiquids.class, child));
case "coolant" -> block.consume((Consume)parser.readValue(ConsumeCoolant.class, child));
case "liquidsBoost" -> block.consume(child.isArray() ? new ConsumeLiquids(parser.readValue(LiquidStack[].class, child)) :
parser.readValue(ConsumeLiquids.class, child)).boost();
case "power" -> {
if(child.isNumber()){
block.consumePower(child.asFloat());
}else{
block.consume((Consume)parser.readValue(ConsumePower.class, child));
}
}
case "powerBuffered" -> block.consumePowerBuffered(child.asFloat());
default -> throw new IllegalArgumentException("Unknown consumption type: '" + child.name + "' for block '" + block.name + "'.");
}
}
value.remove("consumes");
}
private ObjectMap<ContentType, TypeParser<?>> parsers = ObjectMap.of(
ContentType.block, (TypeParser<Block>)(mod, name, value) -> {
readBundle(ContentType.block, name, value);
Block block;
if(allowPatching && locate(ContentType.block, name) != null){
if(value.has("type")){
warn("Warning: '" + currentMod.name + "-" + name + "' re-declares a type. This will be interpreted as a new block. If you wish to override a vanilla block, omit the 'type' section, as vanilla block `type`s cannot be changed.");
block = make(resolve(value.getString("type", ""), Block.class), mod + "-" + name);
}else{
block = locate(ContentType.block, name);
}View on GitHub (pinned to f695ad7e60)
Solutions
- Compare the unknown key against the switch cases in ContentParser.java:535-571 and correct the spelling.
- Confirm the key exists in your target Mindustry build (consume categories are version-locked).
- If you need a non-standard consume, define a custom Consume subclass in code instead of via JSON.
Example fix
// before
"consumes": { "powerBufferd": 60 }
// after
"consumes": { "powerBuffered": 60 } Defensive patterns
Strategy: validation
Validate before calling
// Validate 'consumes' keys against the known set before submitting a mod.
Set<String> valid = Set.of("item","itemCharged","itemFlammable","itemRadioactive",
"itemExplosive","itemList","itemExplode","items","itemsBoost",
"liquidFlammable","liquid","liquids","coolant","liquidsBoost",
"power","powerBuffered");
JsonValue c = value.get("consumes");
if(c != null && c.isObject()){
for(JsonValue child = c.child; child != null; child = child.next){
if(!valid.contains(child.name)) throw new IllegalStateException(
"Unknown consume key '" + child.name + "' in block " + value.getString("name"));
}
} Try / catch
// Wrap mod loading so one bad block doesn't kill the whole load.
try { contentParser.parse(mod, name, json, file, ContentType.block); }
catch(IllegalArgumentException e){
if(e.getMessage().startsWith("Unknown consumption type")) Log.err("Mod " + mod.name + ": " + e.getMessage());
else throw e;
} Prevention
- Keep a checklist of valid consume keys next to your authoring tool.
- Run a JSON lint / schema check that whitelists consume keys before packaging the mod.
When it happens
Trigger: A mod block JSON defines "consumes": {"<typo>": ...} where <typo> is a misspelled or version-incompatible key (e.g. "powerBufferd", "heat", "water"). Only the keys enumerated in the switch are accepted.
Common situations: Misspelling a consume key; using a consume type that existed in a fork/newer build but not the target Mindustry version; copying an example from an outdated wiki.
Related errors
- Blocks cannot be larger than ${maxBlockSize}
- Unit '${name}' has an incorrect type. Types must be strings.
- Missing a valid 'block' in 'requirements'
- SectorPresets must have a sector number.
- Planet '${value.getString("planet")}' not found.
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/b37b10b002886264.
Report an issue: GitHub.