forked from DonoA/PyAnvilEditor
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Donovan Allen
committed
Aug 10, 2018
1 parent
ff063a1
commit 0a3d9e2
Showing
1 changed file
with
31 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |