Function mc_data

Source
pub fn mc_data(version_str: &str) -> Result<Arc<IndexedData>, McDataError>
Expand description

The main entry point to get Minecraft data for a specific version.

Accepts version strings like “1.18.2”, “pc_1.16.5”, “bedrock_1.17.10”, “1.19”. Handles caching of loaded data automatically. On first use for a specific version (or if data is missing from the local cache), it may download the required data files from the PrismarineJS/minecraft-data repository and store them in a local cache directory (typically within the system’s cache location).

§Errors

Returns McDataError if:

  • The version string is invalid or cannot be resolved to a known Minecraft version.
  • Network errors occur during the initial data download.
  • Filesystem errors occur while accessing or writing to the cache directory.
  • Required data files are missing or corrupt (e.g., JSON parsing errors).
  • Internal errors occur (e.g., cache lock poisoning).