Pumpkin-MC/Pumpkin · critical · WorldInfoError

Unsupported world data version

Error message

Unsupported world data version: {0}

What it means

WorldInfoError::UnsupportedDataVersion(i32) is returned when level.dat's DataVersion integer exists but lies outside the range MINIMUM_SUPPORTED_WORLD_DATA_VERSION..=MAXIMUM_SUPPORTED_WORLD_DATA_VERSION (checked in check_data_version, anvil.rs:40-57). It means the world was saved by a much newer or much older Minecraft version than this server supports.

Solutions

  1. Update Pumpkin to a build whose MAXIMUM_SUPPORTED_WORLD_DATA_VERSION covers the world's DataVersion.
  2. Downgrade/upgrade the world with a vanilla Minecraft client of the matching version before loading.
  3. For very old worlds, run them through an intermediate Minecraft version chain to migrate DataVersion upward.
  4. If you control the range check, confirm the world's DataVersion and extend the supported bounds only if the format is actually compatible.

Example fix

// before: attempting to load a newer world on an old server
let level = reader.read_world_info(&path)?; // UnsupportedDataVersion(4189)
// after: check compatibility up front
let dv = get_data_version(&path)?;
assert!(dv <= MAXIMUM_SUPPORTED_WORLD_DATA_VERSION, "update server for DataVersion {dv}");
Defensive patterns

Strategy: validation

Validate before calling

fn data_version_supported(path: &Path) -> Result<bool, String> {
    let root = read_level_dat_root(path).map_err(|e| e.to_string())?;
    let dv = root.get_compound("Data")
        .and_then(|d| d.get_int("DataVersion"))
        .ok_or("no DataVersion")?;
    Ok((MINIMUM_SUPPORTED_WORLD_DATA_VERSION..=MAXIMUM_SUPPORTED_WORLD_DATA_VERSION).contains(&dv))
}

Type guard

fn supported_data_version(dv: i32) -> bool {
    (MINIMUM_SUPPORTED_WORLD_DATA_VERSION..=MAXIMUM_SUPPORTED_WORLD_DATA_VERSION).contains(&dv)
}

Try / catch

match reader.read_world_info(&path) {
    Err(WorldInfoError::UnsupportedDataVersion(dv)) => {
        bail!("world DataVersion {dv} unsupported — update the server or migrate the world");
    }
    other => { other?; }
}

Prevention

When it happens

Trigger: WorldInfoReader::read_world_info reads a level.dat whose 'Data'.'DataVersion' int is below the minimum (very old world) or above the maximum (world saved by a newer client/server release).

Common situations: Opening a world saved by the latest Minecraft snapshot in an older server build; loading a legacy world that predates the minimum supported DataVersion; server binary not yet updated after a Minecraft version bump.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

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

        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)