https://github.com/funnyboy-roks/mca-parser
A library for parsing Minecraft's Region files
https://github.com/funnyboy-roks/mca-parser
hacktoberfest library minecraft minecraft-region rust
Last synced: 4 months ago
JSON representation
A library for parsing Minecraft's Region files
- Host: GitHub
- URL: https://github.com/funnyboy-roks/mca-parser
- Owner: funnyboy-roks
- License: other
- Created: 2023-02-11T02:35:19.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-03-08T16:16:12.000Z (over 2 years ago)
- Last Synced: 2025-07-23T13:51:04.259Z (11 months ago)
- Topics: hacktoberfest, library, minecraft, minecraft-region, rust
- Language: Rust
- Homepage: https://crates.io/crates/mca-parser
- Size: 46.9 KB
- Stars: 3
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# mca-parser
A library for parsing Minecraft's [Region files](https://minecraft.wiki/w/Region_file_format)
## Usage
```rs
// Create a Region from an open file
let mut file = File::open("r.0.0.mca")?;
let region = Region::from_reader(&mut file)?;
// `chunk` is raw chunk data, so we need to parse it
let chunk = region.get_chunk(0, 0)?;
if let Some(chunk) = chunk {
// Parse the raw chunk data into structured NBT format
let parsed = chunk.parse()?;
println!("{:?}", parsed.status);
} else {
// If the chunk is None, it has not been generated
println!("Chunk has not been generated.");
}
```