{"record":{"id":"5b5aa069207b7826","repo":"Pumpkin-MC/Pumpkin","slug":"no-world-seed-found-neither-level-dat-nor-data-mi","errorCode":null,"errorMessage":"No world seed found: neither level.dat nor data/minecraft/world_gen_settings.dat contains one","messagePattern":"No world seed found: neither level\\.dat nor data/minecraft/world_gen_settings\\.dat contains one","errorType":"error_code","errorClass":"WorldInfoError","httpStatus":null,"severity":"error","filePath":"crates/pumpkin-world/src/world_info/mod.rs","lineNumber":369,"sourceCode":"        data.spawn_z = spawn_pos.0.z;\n        data\n    }\n\n    pub const fn set_pos(&mut self, x: i32, z: i32) {\n        self.spawn_x = x;\n        self.spawn_z = z;\n    }\n}\n\n#[derive(Error, Debug)]\npub enum WorldInfoError {\n    #[error(\"Io error: {0}\")]\n    IoError(std::io::ErrorKind),\n    #[error(\"Info not found!\")]\n    InfoNotFound,\n    #[error(\"Deserialization error: {0}\")]\n    DeserializationError(String),\n    #[error(\n        \"No world seed found: neither level.dat nor data/minecraft/world_gen_settings.dat contains one\"\n    )]\n    MissingWorldSeed,\n    #[error(\"Serialization error: {0}\")]\n    SerializationError(String),\n    #[error(\"Unsupported world data version: {0}\")]\n    UnsupportedDataVersion(i32),\n    #[error(\"Unsupported world level version: {0}\")]\n    UnsupportedLevelVersion(i32),\n}\n\nimpl From<std::io::Error> for WorldInfoError {\n    fn from(value: std::io::Error) -> Self {\n        match value.kind() {\n            std::io::ErrorKind::NotFound => Self::InfoNotFound,\n            value => Self::IoError(value),\n        }\n    }","sourceCodeStart":351,"sourceCodeEnd":387,"githubUrl":"https://github.com/Pumpkin-MC/Pumpkin/blob/8d4639e25a57c15e47448ec327c780d41bbf2356/crates/pumpkin-world/src/world_info/mod.rs#L351-L387","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Add a 'seed' long tag to the WorldGenSettings compound in level.dat (e.g. via an NBT editor) with the desired seed.","Regenerate the missing data/minecraft/world_gen_settings.dat, or recreate the world with an explicit --seed so the seed is persisted.","Migrate the world by opening it once in vanilla Minecraft so it writes the full WorldGenSettings data, then load it in Pumpkin.","Check that the level folder layout matches the Anvil reader's expectations (level.dat under the world root)."],"exampleFix":"// before: stripped level.dat without seed\n{ \"Data\": { \"DataVersion\": 3953 } }\n// after: include WorldGenSettings with a seed\n{ \"Data\": { \"DataVersion\": 3953, \"WorldGenSettings\": { \"seed\": 1234567890L } } }","handlingStrategy":"validation","validationCode":"fn seed_available(level_folder: &Path, root: &NbtCompound) -> bool {\n    level_folder.join(\"data/minecraft/world_gen_settings.dat\").is_file()\n        || root.get_compound(\"Data\")\n            .and_then(|d| d.get_compound(\"WorldGenSettings\"))\n            .and_then(|s| s.get_long(\"seed\"))\n            .is_some()\n}","typeGuard":"fn extract_seed(root: &NbtCompound) -> Option<i64> {\n    root.get_compound(\"Data\")?\n        .get_compound(\"WorldGenSettings\")?\n        .get_long(\"seed\")\n}","tryCatchPattern":"match reader.read_world_info(&path) {\n    Err(WorldInfoError::MissingWorldSeed) => {\n        eprintln!(\"no seed found; supplying one explicitly\");\n        inject_seed_into_level_dat(&path, 1234567890)?;\n    }\n    other => { other?; }\n}","preventionTips":["Always create worlds with an explicit seed so it is persisted to level.dat","Open worlds once in vanilla Minecraft so WorldGenSettings is fully written","Do not strip WorldGenSettings from level.dat with NBT editors","Keep data/minecraft/world_gen_settings.dat intact in the level folder"],"tags":["world-info","seed","world-generation","missing-field"],"backgroundTag":"missing-required-config-field","analyzedSha":"8d4639e25a57c15e47448ec327c780d41bbf2356","analyzedAt":"2026-09-09T15:32:22.916Z","contentChangedAt":"2026-09-09T15:32:22.916Z","schemaVersion":2},"datasetVersion":"2026-09-17T15:17:12.973Z"}