twoolie / NBT

Python Parser/Writer for the NBT file format, and it's container the RegionFile.
MIT License
362 stars 74 forks source link

Example of write_chunk #122

Open misode opened 5 years ago

misode commented 5 years ago

I'm trying to save some edits I did to a chunk, but it's giving struct.error: required argument is not an integer for that last line. I can't find any examples that use the write_chunk method.

region = nbt.region.RegionFile(file)
for m in region.get_metadata():
    chunk = region.get_chunk(m.x, m.z)
    # do stuff with the chunk
    region.write_chunk(m.x, m.z, chunk)

image

mfld-fr commented 5 years ago

Could you please add the MC version in your report ?

misode commented 5 years ago

I'm using Minecraft 1.14