Skip to content Skip to sidebar Skip to footer

How Can Read Minecraft .mca Files So That In Python I Can Extract Individual Blocks?

I can't find a way of reading the Minecraft world files in a way that i could use in python I've looked around the internet but can find no tutorials and only a few libraries that

Solution 1:

Use anvil parser. (Install with pip install anvil-parser)

Reading

import anvil

region = anvil.Region.from_file('r.0.0.mca')

# You can also provide the region file name instead of the object
chunk = anvil.Chunk.from_region(region, 0, 0)

# If `section` is not provided, will get it from the y coords# and assume it's global
block = chunk.get_block(0, 0, 0)

print(block) # <Block(minecraft:air)>print(block.id) # airprint(block.properties) # {}

https://pypi.org/project/anvil-parser/

Post a Comment for "How Can Read Minecraft .mca Files So That In Python I Can Extract Individual Blocks?"