Pumpkin-MC/Pumpkin · error · WorldInfoError

No world seed found: neither level.dat nor…

Error message

No world seed found: neither level.dat nor data/minecraft/world_gen_settings.dat contains one

What it means

WorldInfoError::MissingWorldSeed is returned when no world seed can be determined: neither the data/minecraft/world_gen_settings.dat file nor the WorldGenSettings compound inside level.dat contains a seed. The library requires a seed to run world generation, so it fails explicitly instead of guessing one.

Solutions

  1. Add a 'seed' long tag to the WorldGenSettings compound in level.dat (e.g. via an NBT editor) with the desired seed.
  2. Regenerate the missing data/minecraft/world_gen_settings.dat, or recreate the world with an explicit --seed so the seed is persisted.
  3. Migrate the world by opening it once in vanilla Minecraft so it writes the full WorldGenSettings data, then load it in Pumpkin.
  4. Check that the level folder layout matches the Anvil reader's expectations (level.dat under the world root).

Example fix

// before: stripped level.dat without seed
{ "Data": { "DataVersion": 3953 } }
// after: include WorldGenSettings with a seed
{ "Data": { "DataVersion": 3953, "WorldGenSettings": { "seed": 1234567890L } } }
Defensive patterns

Strategy: validation

Validate before calling

fn seed_available(level_folder: &Path, root: &NbtCompound) -> bool {
    level_folder.join("data/minecraft/world_gen_settings.dat").is_file()
        || root.get_compound("Data")
            .and_then(|d| d.get_compound("WorldGenSettings"))
            .and_then(|s| s.get_long("seed"))
            .is_some()
}

Type guard

fn extract_seed(root: &NbtCompound) -> Option<i64> {
    root.get_compound("Data")?
        .get_compound("WorldGenSettings")?
        .get_long("seed")
}

Try / catch

match reader.read_world_info(&path) {
    Err(WorldInfoError::MissingWorldSeed) => {
        eprintln!("no seed found; supplying one explicitly");
        inject_seed_into_level_dat(&path, 1234567890)?;
    }
    other => { other?; }
}

Prevention

When it happens

Trigger: AnvilLevelInfo reads world info and stored_world_seed (anvil.rs:144) returns None: read_world_gen_settings finds no world_gen_settings.dat (or no seed in it) and level.dat's 'WorldGenSettings.seed' long tag is absent.

Common situations: Worlds created by tools or other server software that omit WorldGenSettings.seed; manually trimmed level.dat files; a deleted data/minecraft/world_gen_settings.dat in a custom level layout.

Understand the failure class

Background: "is required", "must be set", "missing required field": configuration validation errors across open-source libraries — this error's family across 36 libraries.

Related errors


AI-assisted analysis of Pumpkin-MC/Pumpkin@8d4639e25a (2026-09-09). Data as JSON: /api/errors/5b5aa069207b7826. Report an issue: GitHub.

Appendix: source

Thrown at crates/pumpkin-world/src/world_info/mod.rs:369

        data.spawn_z = spawn_pos.0.z;
        data
    }

    pub const fn set_pos(&mut self, x: i32, z: i32) {
        self.spawn_x = x;
        self.spawn_z = z;
    }
}

#[derive(Error, Debug)]
pub enum WorldInfoError {
    #[error("Io error: {0}")]
    IoError(std::io::ErrorKind),
    #[error("Info not found!")]
    InfoNotFound,
    #[error("Deserialization error: {0}")]
    DeserializationError(String),
    #[error(
        "No world seed found: neither level.dat nor data/minecraft/world_gen_settings.dat contains one"
    )]
    MissingWorldSeed,
    #[error("Serialization error: {0}")]
    SerializationError(String),
    #[error("Unsupported world data version: {0}")]
    UnsupportedDataVersion(i32),
    #[error("Unsupported world level version: {0}")]
    UnsupportedLevelVersion(i32),
}

impl From<std::io::Error> for WorldInfoError {
    fn from(value: std::io::Error) -> Self {
        match value.kind() {
            std::io::ErrorKind::NotFound => Self::InfoNotFound,
            value => Self::IoError(value),
        }
    }

View on GitHub (pinned to 8d4639e25a)