Anuken/Mindustry · error · MapException

Map has no cores!

Error message

Map has no cores!

What it means

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.

Source

Thrown at core/src/mindustry/core/World.java:387

            if(state.teams.cores(checkRules.defaultTeam).size == 0 && !checkRules.pvp){
                invalidMap = true;
                ui.showErrorMessage(Core.bundle.format("map.nospawn", checkRules.defaultTeam.coloredName()));
            }else if(checkRules.pvp){ //pvp maps need two cores to be valid
                if(state.teams.getActive().count(TeamData::hasCore) < 2){
                    invalidMap = true;
                    ui.showErrorMessage("@map.nospawn.pvp");
                }
            }else if(checkRules.attackMode){ //attack maps need two cores to be valid
                invalidMap = state.rules.waveTeam.data().noCores();
                if(invalidMap){
                    ui.showErrorMessage(Core.bundle.format("map.nospawn.attack", checkRules.waveTeam.coloredName()));
                }
            }
        }else{
            invalidMap = !state.teams.getActive().contains(TeamData::hasCore);

            if(invalidMap){
                throw new MapException(map, "Map has no cores!");
            }
        }

        if(invalidMap) Core.app.post(() -> state.set(State.menu));
    }

    public void addDarkness(Tiles tiles){
        byte[] dark = new byte[tiles.width * tiles.height];
        byte[] writeBuffer = new byte[tiles.width * tiles.height];

        byte darkIterations = darkRadius;

        for(int i = 0; i < dark.length; i++){
            Tile tile = tiles.geti(i);
            if(tile.isDarkened()){
                dark[i] = darkIterations;
            }
        }

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Open the map in the editor and place at least one core block for a team.
  2. If loading a generated/campaign map, ensure the generator places a core (check the planet generator's core-placement logic).
  3. For attack maps, ensure BOTH teams have cores (attack mode requires two).
  4. Re-export the map after adding cores so the save embeds valid core data.

Example fix

// before: editor map has no core tile
// (place a core in the editor)

// after: ensure generator places a core
tiles.set(width/2, height/2, new TileData{ block = Blocks.coreShard, team = defaultTeam });
Defensive patterns

Strategy: validation

Validate before calling

// after load/generation, confirm a team has a core
boolean hasCore = state.teams.getActive().contains(TeamData::hasCore);
if(!hasCore){
    throw new IllegalStateException("Map has no core; place one before play");
}

Try / catch

try{ world.loadMap(map, rules); }catch(MapException e){ ui.showErrorMessage(e.getMessage()); state.set(State.menu); }

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


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