{"record":{"id":"f6fdd29fef12e3cd","repo":"Anuken/Mindustry","slug":"map-has-no-cores","errorCode":null,"errorMessage":"Map has no cores!","messagePattern":"Map has no cores!","errorType":"exception","errorClass":"MapException","httpStatus":null,"severity":"error","filePath":"core/src/mindustry/core/World.java","lineNumber":387,"sourceCode":"            if(state.teams.cores(checkRules.defaultTeam).size == 0 && !checkRules.pvp){\n                invalidMap = true;\n                ui.showErrorMessage(Core.bundle.format(\"map.nospawn\", checkRules.defaultTeam.coloredName()));\n            }else if(checkRules.pvp){ //pvp maps need two cores to be valid\n                if(state.teams.getActive().count(TeamData::hasCore) < 2){\n                    invalidMap = true;\n                    ui.showErrorMessage(\"@map.nospawn.pvp\");\n                }\n            }else if(checkRules.attackMode){ //attack maps need two cores to be valid\n                invalidMap = state.rules.waveTeam.data().noCores();\n                if(invalidMap){\n                    ui.showErrorMessage(Core.bundle.format(\"map.nospawn.attack\", checkRules.waveTeam.coloredName()));\n                }\n            }\n        }else{\n            invalidMap = !state.teams.getActive().contains(TeamData::hasCore);\n\n            if(invalidMap){\n                throw new MapException(map, \"Map has no cores!\");\n            }\n        }\n\n        if(invalidMap) Core.app.post(() -> state.set(State.menu));\n    }\n\n    public void addDarkness(Tiles tiles){\n        byte[] dark = new byte[tiles.width * tiles.height];\n        byte[] writeBuffer = new byte[tiles.width * tiles.height];\n\n        byte darkIterations = darkRadius;\n\n        for(int i = 0; i < dark.length; i++){\n            Tile tile = tiles.geti(i);\n            if(tile.isDarkened()){\n                dark[i] = darkIterations;\n            }\n        }","sourceCodeStart":369,"sourceCodeEnd":405,"githubUrl":"https://github.com/Anuken/Mindustry/blob/f695ad7e60323ebced984fa26d0bcf0bc54296b4/core/src/mindustry/core/World.java#L369-L405","documentation":"Thrown as a MapException during map validation (World) when no active team has a core. Every playable map needs at least one core block so players can spawn; the validator checks state.teams.getActive() for any TeamData with hasCore. Without a core the map is unplayable, so it aborts loading.","triggerScenarios":"After loading/generating a map, the validator finds no team in state.teams.getActive() has a core. Occurs with custom maps whose author deleted all cores, generated maps with no core tile placed, or maps where the core block was removed/renamed by a content change.","commonSituations":"Importing an editor map that has no core; a generator that fails to place a core; maps built in an older version whose core block id no longer resolves to a core; PvP/attack maps that additionally need two cores.","solutions":["Open the map in the editor and place at least one core block for a team.","If loading a generated/campaign map, ensure the generator places a core (check the planet generator's core-placement logic).","For attack maps, ensure BOTH teams have cores (attack mode requires two).","Re-export the map after adding cores so the save embeds valid core data."],"exampleFix":"// before: editor map has no core tile\n// (place a core in the editor)\n\n// after: ensure generator places a core\ntiles.set(width/2, height/2, new TileData{ block = Blocks.coreShard, team = defaultTeam });","handlingStrategy":"validation","validationCode":"// after load/generation, confirm a team has a core\nboolean hasCore = state.teams.getActive().contains(TeamData::hasCore);\nif(!hasCore){\n    throw new IllegalStateException(\"Map has no core; place one before play\");\n}","typeGuard":null,"tryCatchPattern":"try{ world.loadMap(map, rules); }catch(MapException e){ ui.showErrorMessage(e.getMessage()); state.set(State.menu); }","preventionTips":["Always place at least one core in the editor before exporting a map.","For attack maps, place cores for both teams.","Validate generated maps have a core in the generator.","Catch MapException at the load boundary so the game returns to menu cleanly."],"tags":["map","validation","core","world","multiplayer"],"backgroundTag":null,"analyzedSha":"f695ad7e60323ebced984fa26d0bcf0bc54296b4","analyzedAt":"2026-08-14T04:31:16.262Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}