Anuken/Mindustry · error · IllegalArgumentException
All maps must have a core.
Error message
All maps must have a core.
What it means
Thrown by FileMapGenerator.generate after iterating spawn/core tiles. anyCores stays false when no core block was placed, so the map is rejected because every playable map requires at least one core tile to anchor the player and launch loadout.
Source
Thrown at core/src/mindustry/maps/generators/FileMapGenerator.java:145
}else if(tile.build instanceof CoreBuild && tile.team() == state.rules.defaultTeam && tile.build.pos() != params.corePositionOverride){
//other cores placed must be cleared; they have been overridden
tile.remove();
}
}else if(tile.isCenter() && tile.block() instanceof CoreBlock && tile.team() == state.rules.defaultTeam && !anyCores){
if(sector != null && sector.allowLaunchLoadout()){
Schematics.placeLaunchLoadout(tile.x, tile.y);
}
anyCores = true;
if(preset.addStartingItems || !preset.planet.allowLaunchLoadout){
tile.build.items.clear();
tile.build.items.add(state.rules.loadout);
}
}
}
if(!anyCores){
throw new IllegalArgumentException("All maps must have a core.");
}
state.map = map;
}
}
View on GitHub (pinned to f695ad7e60)
Solutions
- Open the map in the editor and place at least one core block, then re-export.
- Confirm the map is intended for a game mode that requires cores; otherwise switch mode.
- If authoring a generator, ensure Schematics.placeLaunchLoadout targets a valid tile with a core.
Example fix
// before: map has zero core tiles -> generate throws 'All maps must have a core.' // after: editor -> place Core:Sharded tile -> save -> generate succeeds
Defensive patterns
Strategy: validation
Validate before calling
// Before generating, confirm the map/preset has at least one core tile.
boolean hasCore = false;
for (int i = 0; i < tiles.width * tiles.height; i++) {
if (tiles.geti(i) == Blocks.coreSharded.id) { hasCore = true; break; }
}
if (!hasCore) throw new IllegalStateException("Map missing a core block"); Prevention
- Always place a core block when authoring maps meant for core-requiring modes.
- Validate map tile data for a core before calling the generator.
- Pair maps with the correct Gamemode in shuffle configurations.
When it happens
Trigger: Generating a map from a preset/.msav whose tile data contains no core block; campaign sector maps or custom maps missing a core, especially for modes that need one.
Common situations: Custom map exported without placing a core block; a campaign map edited to remove its core; using a core-less map in attack/pvp/normal modes.
Related errors
- Sector {sector.id} on planet {sector.planet.name} has no gen
- Map has no cores!
- Map name cannot be empty! File:
AI-assisted analysis of Anuken/Mindustry@f695ad7e60 (2026-08-14).
Data as JSON: /api/errors/a6f5b2b3386082d5.
Report an issue: GitHub.