Skip to content

Commit

Permalink
Add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Donovan Allen committed Aug 10, 2018
1 parent ff063a1 commit 0a3d9e2
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
PyAnvilEditor
===
A python based library for loading and saving minecraft world files. The project includes a method for creating, editing, and saving nbt files as well as a method for loading worlds and editing the chunks and blocks within them.

## NBT
The `nbt` module can load uncompressed binary data in nbt format. Calling `parse_nbt` on a stream of binary data will return a `CompoundTag` encoding the data in the stream. NBT decoding for Minecraft 1.13 includes the following tags:
- `ByteTag`
- `ShortTag`
- `IntTag`
- `LongTag`
- `FloatTag`
- `DoubleTag`
- `ByteArray`
- `IntArray`
- `LongArray`
- `StringTag`
- `ListTag`
- `CompundTag`

Calling `serialize` on an nbt tag with a file stream will write the binary data of the nbt tag to the file.

## World
The `world` module allows the modification and saving of a whole world file. An example of getting a single block using the world module might look like the following:
```
import world
myWorld = world.World("myWorld")
myBlockPos = (15, 10, 25)
myBlock = myWorld.get_block(myBlockPos)
```

`myBlock` now contains the name and properties of the block state at the given location.

0 comments on commit 0a3d9e2

Please sign in to comment.