{"record":{"id":"b37b10b002886264","repo":"Anuken/Mindustry","slug":"unknown-consumption-type-child-name-for-bloc","errorCode":null,"errorMessage":"Unknown consumption type: '${child.name}' for block '${block.name}'.","messagePattern":"Unknown consumption type: '(.+?)' for block '(.+?)'\\.","errorType":"validation","errorClass":"IllegalArgumentException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/mod/ContentParser.java","lineNumber":571,"sourceCode":"                    parser.readValue(ConsumeItems.class, child)).boost();\n\n                case \"liquidFlammable\" -> block.consume((Consume)parser.readValue(ConsumeLiquidFlammable.class, child));\n                case \"liquid\" -> block.consume((Consume)parser.readValue(ConsumeLiquid.class, child));\n                case \"liquids\" -> block.consume(\n                    child.isArray() ? new ConsumeLiquids(parser.readValue(LiquidStack[].class, child)) :\n                    parser.readValue(ConsumeLiquids.class, child));\n                case \"coolant\" -> block.consume((Consume)parser.readValue(ConsumeCoolant.class, child));\n                case \"liquidsBoost\" -> block.consume(child.isArray() ? new ConsumeLiquids(parser.readValue(LiquidStack[].class, child)) :\n                    parser.readValue(ConsumeLiquids.class, child)).boost();\n                case \"power\" -> {\n                    if(child.isNumber()){\n                        block.consumePower(child.asFloat());\n                    }else{\n                        block.consume((Consume)parser.readValue(ConsumePower.class, child));\n                    }\n                }\n                case \"powerBuffered\" -> block.consumePowerBuffered(child.asFloat());\n                default -> throw new IllegalArgumentException(\"Unknown consumption type: '\" + child.name + \"' for block '\" + block.name + \"'.\");\n            }\n        }\n        value.remove(\"consumes\");\n    }\n\n    private ObjectMap<ContentType, TypeParser<?>> parsers = ObjectMap.of(\n        ContentType.block, (TypeParser<Block>)(mod, name, value) -> {\n            readBundle(ContentType.block, name, value);\n\n            Block block;\n\n            if(allowPatching && locate(ContentType.block, name) != null){\n                if(value.has(\"type\")){\n                    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.\");\n                    block = make(resolve(value.getString(\"type\", \"\"), Block.class), mod + \"-\" + name);\n                }else{\n                    block = locate(ContentType.block, name);\n                }","sourceCodeStart":553,"sourceCodeEnd":589,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/mod/ContentParser.java#L553-L589","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":"// before\n\"consumes\": { \"powerBufferd\": 60 }\n// after\n\"consumes\": { \"powerBuffered\": 60 }","handlingStrategy":"validation","validationCode":"// Validate 'consumes' keys against the known set before submitting a mod.\nSet<String> valid = Set.of(\"item\",\"itemCharged\",\"itemFlammable\",\"itemRadioactive\",\n    \"itemExplosive\",\"itemList\",\"itemExplode\",\"items\",\"itemsBoost\",\n    \"liquidFlammable\",\"liquid\",\"liquids\",\"coolant\",\"liquidsBoost\",\n    \"power\",\"powerBuffered\");\nJsonValue c = value.get(\"consumes\");\nif(c != null && c.isObject()){\n    for(JsonValue child = c.child; child != null; child = child.next){\n        if(!valid.contains(child.name)) throw new IllegalStateException(\n            \"Unknown consume key '\" + child.name + \"' in block \" + value.getString(\"name\"));\n    }\n}","typeGuard":null,"tryCatchPattern":"// Wrap mod loading so one bad block doesn't kill the whole load.\ntry { contentParser.parse(mod, name, json, file, ContentType.block); }\ncatch(IllegalArgumentException e){\n    if(e.getMessage().startsWith(\"Unknown consumption type\")) Log.err(\"Mod \" + mod.name + \": \" + e.getMessage());\n    else throw e;\n}","preventionTips":["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."],"tags":["mindustry","modding","json","content-parser","block","consumes"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}