anvil-parser
Simple parser for the Minecraft anvil file format
Installation
This project is available on PyPI and can be installed with pip
pip install anvil-parser
or directly from github
pip install git+https://github.com/matcool/anvil-parser.git
Usage
Reading
import anvil
region = anvil.Region.from_file('r.0.0.mca')
chunk = anvil.Chunk.from_region(region, 0, 0)
block = chunk.get_block(0, 0, 0)
print(block)
print(block.id)
print(block.properties)
Making own regions
import anvil
from random import choice
region = anvil.EmptyRegion(0, 0)
stone = anvil.Block('minecraft', 'stone')
dirt = anvil.Block('minecraft', 'dirt')
for y in range(16):
for z in range(16):
for x in range(16):
region.set_block(choice((stone, dirt)), x, y, z)
region.save('r.0.0.mca')
Todo
things to do before 1.0.0
Note
Testing done in 1.14.4 and 1.15.2, should work fine for other versions.