Anuken/Mindustry · error · IOException

Failed to read tile entity of block:

Error message

Failed to read tile entity of block: 

What it means

LegacySaveVersion reads building data from a very old save using a legacy per-block read path (health, team, rotation, items/power/liquids, then tile.build.read). Any Throwable thrown during that read is wrapped in an IOException naming the offending block. The message identifies which block failed; the wrapped cause carries the real reason.

Source

Thrown at core/src/mindustry/io/versions/LegacySaveVersion.java:85

                            tile.build.health = stream.readUnsignedShort();
                            byte packedrot = stream.readByte();
                            byte team = Pack.leftByte(packedrot) == 8 ? stream.readByte() : Pack.leftByte(packedrot);
                            byte rotation = Pack.rightByte(packedrot);

                            tile.setTeam(Team.get(team));
                            tile.build.rotation = rotation;

                            if(tile.build.items != null) tile.build.items.read(in, true);
                            if(tile.build.power != null) tile.build.power.read(in, true);
                            if(tile.build.liquids != null) tile.build.liquids.read(in, true);
                            //skip cons.valid boolean, it's not very important here
                            stream.readByte();

                            //read only from subclasses!
                            tile.build.read(in, version);
                        });
                    }catch(Throwable e){
                        throw new IOException("Failed to read tile entity of block: " + block, e);
                    }

                    context.onReadBuilding();
                }else{
                    int consecutives = stream.readUnsignedByte();

                    //air is a waste of time and may mess up multiblocks
                    if(block != Blocks.air){
                        for(int j = i + 1; j < i + 1 + consecutives; j++){
                            context.tile(j).setBlock(block);
                        }
                    }

                    i += consecutives;
                }
            }
        }finally{
            if(!generating) context.end();

View on GitHub (pinned to f695ad7e60)

Solutions

  1. Inspect the wrapped cause (e.getCause()) to find the real failure.
  2. If the save is from an unsupported old version, start a new save.
  3. Update and align mods to the versions that created the save.
Defensive patterns

Strategy: try-catch

Try / catch

try {
    legacyVersion.read(stream, context);
} catch(IOException e) {
    Log.err("Save load failed for block: " + e.getMessage(), e.getCause());
    // e.getMessage() names the block; e.getCause() is the real failure
}

Prevention

When it happens

Trigger: Loading a legacy save where a building's serialized data is corrupt or in a format the current block class cannot read.

Common situations: Loading saves from much older game versions; a mod that changed a block's read/write format since the save was made; partial save corruption.

Related errors


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