# mceditlib package — mceditlib 0.1 documentation

### Navigation

- index
- modules |
- next |
- previous |
- mceditlib 0.1 documentation »

# mceditlib package

## Subpackages

- mceditlib.anvil package
  - Submodules
  - mceditlib.anvil.adapter module
  - mceditlib.anvil.biome_types module
  - mceditlib.anvil.entities module
  - mceditlib.anvil.worldfolder module
  - Module contents
- mceditlib.blocktypes package
  - Module contents
- mceditlib.operations package
  - Submodules
  - mceditlib.operations.block_fill module
  - mceditlib.operations.entity module
  - Module contents
- mceditlib.pc package
  - Submodules
  - mceditlib.pc.regionfile module
  - Module contents
- mceditlib.selection package
  - Module contents
- mceditlib.test package
  - Submodules
  - mceditlib.test.anvil_test module
  - mceditlib.test.editing_test module
  - mceditlib.test.entity_test module
  - mceditlib.test.extended_id_test module
  - mceditlib.test.nbt_test module
  - mceditlib.test.relight_test module
  - mceditlib.test.revisionhistory_test module
  - mceditlib.test.schematic_test module
  - mceditlib.test.server_test module
  - mceditlib.test.session_lock_test module
  - mceditlib.test.templevel module
  - mceditlib.test.time_exportimport module
  - mceditlib.test.time_fill module
  - mceditlib.test.time_getsetblocks module
  - mceditlib.test.time_loadsave module
  - mceditlib.test.time_nbt module
  - mceditlib.test.time_relight module
  - mceditlib.test.time_storagechain module
  - Module contents
- mceditlib.util package
  - Submodules
  - mceditlib.util.unique_nd module
  - Module contents

## Submodules

## mceditlib.block_copy module

block_copy.py

Optimized functions for copying all world data (blocks, tile entities, entities, biomes) from one world or schematic file to another.

`mceditlib.block_copy.``convertBlocks`(destLevel, sourceLevel, blocks, blockData)

`mceditlib.block_copy.``sourceMaskFunc`(blocksToCopy)

`mceditlib.block_copy.``copyBlocksIter`(destLevel, sourceLevel, sourceSelection, destinationPoint, blocksToCopy=None, entities=True, create=False, biomes=False)

  Copy blocks and entities from the `sourceBox` area of `sourceLevel` to `destLevel` starting at `destinationPoint`.

  Parameters:

  - sourceLevel – ISectionWorld
  - destLevel – ISectionWorld

  Optional parameters:
    - `blocksToCopy`: list of blockIDs to copy.
    - `entities`: True to copy Entities and TileEntities, False otherwise.
    - `create`: True to create new chunks in destLevel, False otherwise.
    - `biomes`: True to copy biome data, False otherwise.

## mceditlib.blockrotation module

blockrotation.py

Functions for adjusting blockdatas after rotating, rolling, flipping or mirroring a schematic file.

Most of this file initializes the gigantic lookup tables that list the new blockdata for each blocktype and rotation type. A lot of this should be moved to the block definition file (minecraft.json) by naming the different blockdata values with directions and inferring the rotations from those. Only certain blocks (e.g. Doors and Vines) need special handling during rotation.

Entities and TileEntities are rotated in schematic.py.

`mceditlib.blockrotation.``genericVerticalFlip`(cls)

`mceditlib.blockrotation.``genericRotation`(cls)

`mceditlib.blockrotation.``genericEastWestFlip`(cls)

`mceditlib.blockrotation.``genericNorthSouthFlip`(cls)

`mceditlib.blockrotation.``genericFlipRotation`(cls)

`mceditlib.blockrotation.``masterRotationTable`(attrname)

`mceditlib.blockrotation.``rotationTypeTable`()

class `mceditlib.blockrotation.``BlockRotation`
  `rotateLeft` = array([[ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], ..., [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15]], dtype=uint8, shape=(4096L, 16L))
  `flipEastWest` = array([[ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], ..., [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15]], dtype=uint8, shape=(4096L, 16L))
  `flipNorthSouth` = array([[ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], ..., [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15]], dtype=uint8, shape=(4096L, 16L))
  `flipVertical` = array([[ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], ..., [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15], [ 0, 1, 2, ..., 13, 14, 15]], dtype=uint8, shape=(4096L, 16L))
  `typeTable` = {}

`mceditlib.blockrotation.``SameRotationType`(blocktype1, blocktype2)

`mceditlib.blockrotation.``FlipVertical`(blocks, data)

`mceditlib.blockrotation.``FlipNorthSouth`(blocks, data)

`mceditlib.blockrotation.``FlipEastWest`(blocks, data)

`mceditlib.blockrotation.``RotateLeft`(blocks, data)

## mceditlib.cachefunc module

class `mceditlib.cachefunc.``Counter`

  Bases: `dict`

  Mapping where default values are zero

`mceditlib.cachefunc.``lru_cache`(maxsize=100)

  Least-recently-used cache decorator.

  Arguments to the cached function must be hashable. Cache performance statistics stored in f.hits and f.misses. Clear the cache with f.clear(). http://en.wikipedia.org/wiki/Cache_algorithms#Least_Recently_Used

`mceditlib.cachefunc.``lfu_cache`(maxsize=100)

  Least-frequenty-used cache decorator.

  Arguments to the cached function must be hashable. Cache performance statistics stored in f.hits and f.misses. Clear the cache with f.clear(). http://en.wikipedia.org/wiki/Least_Frequently_Used

## mceditlib.directories module

directories.py

On initialization, finds the default location for Minecraft saves and stores it in saveFileDir.

## mceditlib.exceptions module

exception `mceditlib.exceptions.``PlayerNotFound`

  Bases: `exceptions.KeyError`

  Requested player not found in level.

exception `mceditlib.exceptions.``ChunkNotPresent`

  Bases: `exceptions.KeyError`

  Requested chunk not found in level.

exception `mceditlib.exceptions.``ChunkSizeError`

  Bases: `exceptions.ValueError`

  Attempted to save a chunk larger than region file’s allocation limit (1 MB)

exception `mceditlib.exceptions.``LevelFormatError`

  Bases: `exceptions.Exception`

  General error for level data not being formatted as expected

exception `mceditlib.exceptions.``RegionMalformed`

  Bases: `mceditlib.exceptions.LevelFormatError`

  Region index entry points outside of the file or to an incomplete sector. Region compress type is unknown.

exception `mceditlib.exceptions.``ChunkMalformed`

  Bases: `mceditlib.exceptions.LevelFormatError`

  Chunk did not have an expected NBT tag.

## mceditlib.export module

export.py

Extracting schematic files of diffeerent formats

`mceditlib.export.``extractSchematicFrom`(sourceDim, box, entities=True)

`mceditlib.export.``extractSchematicFromIter`(sourceDim, box, entities=True)

`mceditlib.export.``extractZipSchematicFrom`(sourceLevel, box, zipfilename=None, entities=True)

`mceditlib.export.``extractZipSchematicFromIter`(sourceLevel, box, zipfilename=None, entities=True)

`mceditlib.export.``extractAnySchematic`(level, box)

`mceditlib.export.``extractAnySchematicIter`(level, box)

`mceditlib.export.``adjustExtractionParameters`(dim, box)

## mceditlib.faces module

class `mceditlib.faces.``Face`

  Bases: `int`

  `dimension`
  `direction`
  `name`
  classmethod `fromVector`(v)
  `vector`

## mceditlib.findadapter module

${NAME}

`mceditlib.findadapter.``findAdapter`(filename, readonly=False, resume=None)

  Try to identify the given file and find an adapter that will open it. Returns an Adapter object if a class is found, and raises ValueError if no classes were able to open it.

  Knows about ZipSchematic, PocketWorldAdapter, WorldEditor, JavaLevel, IndevLevel, SchematicFile, and INVEditChest

  Parameters: | filename (string) – The file to open

`mceditlib.findadapter.``isLevel`(cls, filename)

  Return True if the given level adapter can load the given filename, False otherwise. Tries to call cls.canOpenFile on the filename, then cls._isDataLevel on the file’s data, then cls._isTagLevel on an NBT tree loaded from that data. If none of these methods are present, return False.

  Subclasses should implement one of canOpenFile, _isDataLevel, or _isTagLevel.

## mceditlib.geometry module

box.py

Defines two geometric primitives: A `Vector` that can represent either a point or vector, and an axis-aligned `BoundingBox` which is made from two Vectors.

class `mceditlib.geometry.``Vector`

  Bases: `mceditlib.geometry._Vector`

  `lengthSquared`()
  `length`()
  `normalize`()
  `intfloor`()
  `cross`(other)
  `abs`()
  `chunkPos`()

class `mceditlib.geometry.``Ray`(point, vector)

  Bases: `object`

  classmethod `fromPoints`(p1, p2)
  `atHeight`(h)
  `intersectPlane`(dim, pos)

    Return type: | Vector

## mceditlib.heightmaps module

heightmaps.py

Functions for computing general heightmaps and updating the special HeightMap attribute of modern chunks.

`mceditlib.heightmaps.``extractHeights`(array)

  Given an array of bytes shaped (y, z, x), return the coordinates of the highest non-zero value in each y-column into heightMap

## mceditlib.items module

items.py

Reads the items.txt used by INVEdit to load item definitions.

class `mceditlib.items.``ItemType`(id, name, imagefile=None, imagecoords=None, maxdamage=0, damagevalue=0, stacksize=64)

  Bases: `object`

class `mceditlib.items.``Items`(filename=None)

  Bases: `object`

  `items_txt` = "\n:version 34\n:mc-version Minecraft 1.4\n\n# Blocks\n# ID NAME FILE CORDS DAMAGE\n 1 Stone terrain.png 1,0\n 2 Grass terrain.png 3,0\n 3 Dirt terrain.png 2,0\n 4 Cobblestone terrain.png 0,1\n 5 Oak_Wooden_Planks terrain.png 4,0 0\n 5 Spruce_Wooden_Planks terrain.png 6,12 1\n 5 Birch_Wooden_Planks terrain.png 6,13 2\n 5 Jungle_Wooden_Planks terrain.png 7,12 3\n 6 Oak_Sapling terrain.png 15,0 0\n 6 Spruce_Sapling terrain.png 15,3 1\n 6 Birch_Sapling terrain.png 15,4 2\n 6 Jungle_Sapling terrain.png 14,1 3\n 7 Bedrock terrain.png 1,1\n 8 Water terrain.png 15,13\n 9 Still_Water terrain.png 15,13\n 10 Lava terrain.png 15,15\n 11 Still_Lava terrain.png 15,15\n 12 Sand terrain.png 2,1\n 13 Gravel terrain.png 3,1\n 14 Gold_Ore terrain.png 0,2\n 15 Iron_Ore terrain.png 1,2\n 16 Coal_Ore terrain.png 2,2\n 17 Oak_Wood terrain.png 4,1 0\n 17 Dark_Wood terrain.png 4,7 1\n 17 Birch_Wood terrain.png 5,7 2\n 17 Jungle_Wood terrain.png 9,9 3\n 18 Oak_Leaves special.png 15,0 0\n 18 Dark_Leaves special.png 14,1 1\n 18 Birch_Leaves special.png 14,2 2\n 18 Jungle_Leaves special.png 14,3 3\n 19 Sponge terrain.png 0,3\n 20 Glass terrain.png 1,3\n 21 Lapis_Lazuli_Ore terrain.png 0,10\n 22 Lapis_Lazuli_Block terrain.png 0,9\n 23 Dispenser terrain.png 14,2\n 24 Sandstone terrain.png 0,12 0\n 24 Chiseled_Sandstone terrain.png 5,14 1\n 24 Smooth_Sandstone terrain.png 6,14 2\n 25 Note_Block terrain.png 10,4\n 26 Bed_Block terrain.png 6,8\n 27 Powered_Rail terrain.png 3,10\n 28 Detector_Rail terrain.png 3,12\n 29 Sticky_Piston terrain.png 10,6\n 30 Cobweb terrain.png 11,0\n 31 Dead_Bush terrain.png 7,3 0\n 31 Tall_Grass special.png 15,0 1\n 31 Fern special.png 15,1 2\n 32 Dead_Bush terrain.png 7,3\n 33 Piston terrain.png 11,6\n 34 Piston_(head) terrain.png 11,6\n 35 Wool terrain.png 0,4 0\n 35 Orange_Wool terrain.png 2,13 1\n 35 Magenta_Wool terrain.png 2,12 2\n 35 Light_Blue_Wool terrain.png 2,11 3\n 35 Yellow_Wool terrain.png 2,10 4\n 35 Lime_Wool terrain.png 2,9 5\n 35 Pink_Wool terrain.png 2,8 6\n 35 Gray_Wool terrain.png 2,7 7\n 35 Light_Gray_Wool terrain.png 1,14 8\n 35 Cyan_Wool terrain.png 1,13 9\n 35 Purple_Wool terrain.png 1,12 10\n 35 Blue_Wool terrain.png 1,11 11\n 35 Brown_Wool terrain.png 1,10 12\n 35 Green_Wool terrain.png 1,9 13\n 35 Red_Wool terrain.png 1,8 14\n 35 Black_Wool terrain.png 1,7 15\n 37 Flower terrain.png 13,0\n 38 Rose terrain.png 12,0\n 39 Brown_Mushroom terrain.png 13,1\n 40 Red_Mushroom terrain.png 12,1\n 41 Block_of_Gold terrain.png 7,1\n 42 Block_of_Iron terrain.png 6,1\n 43 Double_Stone_Slab terrain.png 5,0 0\n 43 Double_Sandstone_Slab terrain.png 0,12 1\n 43 Double_Wooden_Slab terrain.png 4,0 2\n 43 Double_Stone_Slab terrain.png 0,1 3\n 44 Stone_Slab special.png 2,2 0\n 44 Sandstone_Slab special.png 8,0 1\n 44 Wooden_Slab special.png 3,0 2\n 44 Stone_Slab special.png 1,0 3\n 44 Brick_Slab special.png 0,0 4\n 44 Stone_Brick_Slab special.png 2,0 5\n 45 Bricks terrain.png 7,0\n 46 TNT terrain.png 8,0\n 47 Bookshelf terrain.png 3,2\n 48 Moss_Stone terrain.png 4,2\n 49 Obsidian terrain.png 5,2\n 50 Torch terrain.png 0,5\n 51 Fire special.png 0,5\n 52 Monster_Spawner terrain.png 1,4\n 53 Oak_Wood_Stair special.png 3,1\n 54 Chest special.png 0,6\n 55 Redstone_Dust terrain.png 4,5\n 56 Diamond_Ore terrain.png 2,3\n 57 Block_of_Diamond terrain.png 8,1\n 58 Workbench terrain.png 12,3 (x1)\n 59 Crops terrain.png 15,5\n 60 Farmland terrain.png 7,5\n 61 Furnace terrain.png 12,2\n 62 Lit_Furnace terrain.png 13,3\n 63 Sign_Block terrain.png 0,0\n 64 Wooden_Door_Block terrain.png 1,6\n 65 Ladder terrain.png 3,5\n 66 Rail terrain.png 0,8\n 67 Stone_Stairs special.png 1,1\n 68 Wall_Sign terrain.png 4,0\n 69 Lever terrain.png 0,6\n 70 Stone_Pressure_Plate special.png 2,4\n 71 Iron_Door_Block terrain.png 2,6\n 72 Wooden_Pressure_Plate special.png 3,4\n 73 Redstone_Ore terrain.png 3,3\n 74 Glowing_Redstone_Ore terrain.png 3,3\n 75 Redstone_Torch_(off) terrain.png 3,7\n 76 Redstone_Torch terrain.png 3,6\n 77 Stone_Button special.png 2,3\n 78 Snow_Layer special.png 1,4\n 79 Ice terrain.png 3,4\n 80 Snow terrain.png 2,4\n 81 Cactus terrain.png 6,4\n 82 Clay terrain.png 8,4\n 83 Sugar_cane terrain.png 9,4\n 84 Jukebox terrain.png 10,4\n 85 Fence special.png 3,2\n 86 Pumpkin terrain.png 7,7\n 87 Netherrack terrain.png 7,6\n 88 Soul_Sand terrain.png 8,6\n 89 Glowstone terrain.png 9,6\n 90 Portal special.png 1,5\n 91 Jack-o'-lantern terrain.png 8,7\n 92 Cake special.png 0,4\n 93 Repeater_Block_(off) terrain.png 3,8\n 94 Repeater_Block terrain.png 3,9\n 95 Locked_Chest special.png 0,2\n 96 Trapdoor terrain.png 4,5\n 97 Silverfish_Block terrain.png 1,0\n 98 Stone_Brick terrain.png 6,3 0\n 98 Mossy_Stone_Brick terrain.png 4,6 1\n 98 Cracked_Stone_Brick terrain.png 5,6 2\n 98 Chiseled_Stone_Brick terrain.png 5,13 3\n 99 Brown_Mushroom_Block terrain.png 13,7\n 100 Red_Mushroom_Block terrain.png 14,7\n 101 Iron_Bars terrain.png 5,5\n 102 Glass_Pane special.png 1,3\n 103 Melon terrain.png 8,8\n 104 Pumpkin_Stem special.png 15,4\n 105 Melon_Stem special.png 15,4\n 106 Vines special.png 15,2\n 107 Fence_Gate special.png 4,3\n 108 Brick_Stairs special.png 0,1\n 109 Stone_Brick_Stairs special.png 2,1\n 110 Mycelium terrain.png 13,4\n 111 Lily_Pad special.png 15,3\n 112 Nether_Brick terrain.png 0,14\n 113 Nether_Brick_Fence special.png 7,2\n 114 Nether_Brick_Stairs special.png 7,1\n 115 Nether_Wart terrain.png 2,14\n 116 Enchantment_Table terrain.png 6,11 (x1)\n 117 Brewing_Stand terrain.png 13,9\n 118 Cauldron terrain.png 10,9\n 119 End_Portal special.png 2,5\n 120 End_Portal_Frame terrain.png 15,9\n 121 End_Stone terrain.png 15,10\n 122 Dragon_Egg special.png 0,7\n 123 Redstone_Lamp terrain.png 3,13\n 124 Redstone_Lamp_(on) terrain.png 4,13\n 125 Oak_Wooden_D._Slab terrain.png 4,0 0\n 125 Spruce_Wooden_D._Slab terrain.png 6,12 1\n 125 Birch_Wooden_D._Slab terrain.png 6,13 2\n 125 Jungle_Wooden_D._Slab terrain.png 7,12 3\n 126 Oak_Wooden_Slab special.png 3,0 0\n 126 Spruce_Wooden_Slab special.png 4,0 1\n 126 Birch_Wooden_Slab special.png 5,0 2\n 126 Jungle_Wooden_Slab special.png 6,0 3\n 127 Cocoa_Plant special.png 15,5\n 128 Sandstone_Stairs special.png 8,1\n 129 Emerald_Ore terrain.png 11,10\n 130 Ender_Chest special.png 1,6\n 131 Tripwire_Hook terrain.png 12,10\n 132 Tripwire terrain.png 5,11\n 133 Block_of_Emerald terrain.png 9,1\n 134 Spruce_Wood_Stairs special.png 4,1\n 135 Birch_Wood_Stairs special.png 5,1\n 136 Jungle_Wood_Stairs special.png 6,1\n 137 Command_Block terrain.png 8,11\n 138 Beacon special.png 2,6\n 139 Cobblestone_Wall special.png 1,2 0\n 140 Moss_Stone_Wall special.png 0,2 1\n 141 Flower_Pot terrain.png 9,11\n 142 Carrots terrain.png 11,12\n 143 Potatoes terrain.png 12,12\n 144 Wooden_Button special.png 3,3\n 145 Head items.png 0,14\n 146 Anvil special.png 3,6 0\n 146 Slightly_Damaged_Anvil special.png 4,6 1\n 146 Very_Damaged_Anvil special.png 5,6 2\n\n# Items\n# ID NAME FILE CORDS DAMAGE\n 256 Iron_Shovel items.png 2,5 +250\n 257 Iron_Pickaxe items.png 2,6 +250\n 258 Iron_Axe items.png 2,7 +250\n 259 Flint_and_Steel items.png 5,0 +64\n 260 Apple items.png 10,0\n 261 Bow items.png 5,1 +384\n 262 Arrow items.png 5,2\n 263 Coal items.png 7,0 0\n 263 Charcoal items.png 7,0 1\n 264 Diamond items.png 7,3\n 265 Iron_Ingot items.png 7,1\n 266 Gold_Ingot items.png 7,2\n 267 Iron_Sword items.png 2,4 +250\n 268 Wooden_Sword items.png 0,4 +59\n 269 Wooden_Shovel items.png 0,5 +59\n 270 Wooden_Pickaxe items.png 0,6 +59\n 271 Wooden_Axe items.png 0,7 +59\n 272 Stone_Sword items.png 1,4 +131\n 273 Stone_Shovel items.png 1,5 +131\n 274 Stone_Pickaxe items.png 1,6 +131\n 275 Stone_Axe items.png 1,7 +131\n 276 Diamond_Sword items.png 3,4 +1561\n 277 Diamond_Shovel items.png 3,5 +1561\n 278 Diamond_Pickaxe items.png 3,6 +1561\n 279 Diamond_Axe items.png 3,7 +1561\n 280 Stick items.png 5,3\n 281 Bowl items.png 7,4\n 282 Mushroom_Stew items.png 8,4 x1\n 283 Golden_Sword items.png 4,4 +32\n 284 Golden_Shovel items.png 4,5 +32\n 285 Golden_Pickaxe items.png 4,6 +32\n 286 Golden_Axe items.png 4,7 +32\n 287 String items.png 8,0\n 288 Feather items.png 8,1\n 289 Gunpowder items.png 8,2\n 290 Wooden_Hoe items.png 0,8 +59\n 291 Stone_Hoe items.png 1,8 +131\n 292 Iron_Hoe items.png 2,8 +250\n 293 Diamond_Hoe items.png 3,8 +1561\n 294 Golden_Hoe items.png 4,8 +32\n 295 Seeds items.png 9,0\n 296 Wheat items.png 9,1\n 297 Bread items.png 9,2\n 298 Leather_Cap items.png 0,0 +34\n 299 Leather_Tunic items.png 0,1 +48\n 300 Leather_Pants items.png 0,2 +46\n 301 Leather_Boots items.png 0,3 +40\n 302 Chainmail_Helmet items.png 1,0 +68\n 303 Chainmail_Chestplate items.png 1,1 +96\n 304 Chainmail_Leggings items.png 1,2 +92\n 305 Chainmail_Boots items.png 1,3 +80\n 306 Iron_Helmet items.png 2,0 +136\n 307 Iron_Chestplate items.png 2,1 +192\n 308 Iron_Leggings items.png 2,2 +184\n 309 Iron_Boots items.png 2,3 +160\n 310 Diamond_Helmet items.png 3,0 +272\n 311 Diamond_Chestplate items.png 3,1 +384\n 312 Diamond_Leggings items.png 3,2 +368\n 313 Diamond_Boots items.png 3,3 +320\n 314 Golden_Helmet items.png 4,0 +68\n 315 Golden_Chestplate items.png 4,1 +96\n 316 Golden_Leggings items.png 4,2 +92\n 317 Golden_Boots items.png 4,3 +80\n 318 Flint items.png 6,0\n 319 Raw_Porkchop items.png 7,5\n 320 Cooked_Porkchop items.png 8,5\n 321 Painting items.png 10,1\n 322 Golden_Apple items.png 11,0\n 322 Ench._Golden_Apple special.png 0,3 1\n 323 Sign items.png 10,2 x16\n 324 Wooden_Door items.png 11,2 x1\n 325 Bucket items.png 10,4 x16\n 326 Water_Bucket items.png 11,4 x1\n 327 Lava_Bucket items.png 12,4 x1\n 328 Minecart items.png 7,8 x1\n 329 Saddle items.png 8,6 x1\n 330 Iron_Door items.png 12,2 x1\n 331 Redstone items.png 8,3\n 332 Snowball items.png 14,0 x16\n 333 Boat items.png 8,8 x1\n 334 Leather items.png 7,6\n 335 Milk items.png 13,4 x1\n 336 Brick items.png 6,1\n 337 Clay items.png 9,3\n 338 Sugar_Canes items.png 11,1\n 339 Paper items.png 10,3\n 340 Book items.png 11,3\n 341 Slimeball items.png 14,1\n 342 Minecart_with_Chest items.png 7,9 x1\n 343 Minecart_with_Furnace items.png 7,10 x1\n 344 Egg items.png 12,0\n 345 Compass items.png 6,3 (x1)\n 346 Fishing_Rod items.png 5,4 +64\n 347 Clock items.png 6,4 (x1)\n 348 Glowstone_Dust items.png 9,4\n 349 Raw_Fish items.png 9,5\n 350 Cooked_Fish items.png 10,5\n 351 Ink_Sack items.png 14,4 0\n 351 Rose_Red items.png 14,5 1\n 351 Cactus_Green items.png 14,6 2\n 351 Coco_Beans items.png 14,7 3\n 351 Lapis_Lazuli items.png 14,8 4\n 351 Purple_Dye items.png 14,9 5\n 351 Cyan_Dye items.png 14,10 6\n 351 Light_Gray_Dye items.png 14,11 7\n 351 Gray_Dye items.png 15,4 8\n 351 Pink_Dye items.png 15,5 9\n 351 Lime_Dye items.png 15,6 10\n 351 Dandelion_Yellow items.png 15,7 11\n 351 Light_Blue_Dye items.png 15,8 12\n 351 Magenta_Dye items.png 15,9 13\n 351 Orange_Dye items.png 15,10 14\n 351 Bone_Meal items.png 15,11 15\n 352 Bone items.png 12,1\n 353 Sugar items.png 13,0\n 354 Cake items.png 13,1 x1\n 355 Bed items.png 13,2 x1\n 356 Redstone_Repeater items.png 6,5\n 357 Cookie items.png 12,5\n 358 Map items.png 12,3 x1\n 359 Shears items.png 13,5 +238\n 360 Melon items.png 13,6\n 361 Pumpkin_Seeds items.png 13,3\n 362 Melon_Seeds items.png 14,3\n 363 Raw_Beef items.png 9,6\n 364 Steak items.png 10,6\n 365 Raw_Chicken items.png 9,7\n 366 Cooked_Chicken items.png 10,7\n 367 Rotten_Flesh items.png 11,5\n 368 Ender_Pearl items.png 11,6\n 369 Blaze_Rod items.png 12,6\n 370 Ghast_Tear items.png 11,7\n 371 Gold_Nugget items.png 12,7\n 372 Nether_Wart items.png 13,7\n 374 Glass_Bottle items.png 12,8\n 375 Spider_Eye items.png 11,8\n 376 Fermented_Spider_Eye items.png 10,8\n 377 Blaze_Powder items.png 13,9\n 378 Magma_Cream items.png 13,10\n 379 Brewing_Stand items.png 12,10 (x1)\n 380 Cauldron items.png 12,9 (x1)\n 381 Eye_of_Ender items.png 11,9\n 382 Glistering_Melon items.png 9,8\n 383 Spawn_Egg items.png 9,9\n 384 Bottle_o'_Enchanting items.png 11,10\n 385 Fire_Charge items.png 14,2\n 386 Book_and_Quill items.png 11,11 x1\n 387 Written_Book items.png 12,11 x1\n 388 Emerald items.png 10,11\n 389 Item_Frame items.png 14,12\n 390 Flower_Pot items.png 13,11\n 391 Carrot items.png 8,7\n 392 Potato items.png 7,7\n 393 Baked_Potato items.png 6,7\n 394 Poisonous_Potato items.png 6,8\n 395 Empty_Map items.png 13,12 x1\n 396 Golden_Carrot items.png 6,9\n 397 Skeleton_Head items.png 0,14 0\n 397 Wither_Skeleton_Head items.png 1,14 1\n 397 Zombie_Head items.png 2,14 2\n 397 Human_Head items.png 3,14 3\n 397 Creeper_Head items.png 4,14 4\n 398 Carrot_on_a_Stick items.png 6,6 +25\n 399 Nether_Star items.png 9,11\n 400 Pumpkin_Pie items.png 8,9\n2256 C418_-_13 items.png 0,15 x1\n2257 C418_-_cat items.png 1,15 x1\n2258 C418_-_blocks items.png 2,15 x1\n2259 C418_-_chirp items.png 3,15 x1\n2260 C418_-_far items.png 4,15 x1\n2261 C418_-_mall items.png 5,15 x1\n2262 C418_-_mellohi items.png 6,15 x1\n2263 C418_-_stal items.png 7,15 x1\n2264 C418_-_strad items.png 8,15 x1\n2265 C418_-_ward items.png 9,15 x1\n2266 C418_-_11 items.png 10,15 x1\n\n# Potions\n# ID NAME FILE CORDS DAMAGE\n 373 Water_Bottle special.png 0,14 0\n 373 Awkward_Potion special.png 1,14 16\n 373 Thick_Potion special.png 1,14 32\n 373 Mundane_Potion special.png 1,14 64\n 373 Mundane_Potion special.png 1,14 8192\n 373 Regeneration_(0:45) special.png 2,14 8193\n 373 Regeneration_(2:00) special.png 2,14 8257\n 373 Regeneration_II_(0:22) special.png 2,14 8225\n 373 Swiftness_(3:00) special.png 3,14 8194\n 373 Swiftness_(8:00) special.png 3,14 8258\n 373 Swiftness_II_(1:30) special.png 3,14 8226\n 373 Fire_Resistance_(3:00) special.png 4,14 8195\n 373 Fire_Resistance_(3:00) special.png 4,14 8227\n 373 Fire_Resistance_(8:00) special.png 4,14 8259\n 373 Healing special.png 6,14 8197\n 373 Healing special.png 6,14 8261\n 373 Healing_II special.png 6,14 8229\n 373 Strength_(3:00) special.png 8,14 8201\n 373 Strength_(8:00) special.png 8,14 8265\n 373 Strength_II_(1:30) special.png 8,14 8233\n 373 Poison_(0:45) special.png 5,14 8196\n 373 Poison_(2:00) special.png 5,14 8260\n 373 Poison_II_(0:22) special.png 5,14 8228\n 373 Weakness_(1:30) special.png 7,14 8200\n 373 Weakness_(1:30) special.png 7,14 8332\n 373 Weakness_(4:00) special.png 7,14 8264\n 373 Slowness_(1:30) special.png 9,14 8202\n 373 Slowness_(1:30) special.png 9,14 8234\n 373 Slowness_(4:00) special.png 9,14 8266\n 373 Harming special.png 10,14 8204\n 373 Harming special.png 10,14 8268\n 373 Harming_II special.png 10,14 8236\n# Unbrewable:\n 373 Regeneration_II_(1:00) special.png 2,14 8289\n 373 Swiftness_II_(4:00) special.png 3,14 8290\n 373 Strength_II_(4:00) special.png 8,14 8297\n 373 Poison_II_(1:00) special.png 5,14 8292\n\n# Splash Potions\n# ID NAME FILE CORDS DAMAGE\n 373 Splash_Mundane special.png 1,13 16384\n 373 Regeneration_(0:33) special.png 2,13 16385\n 373 Regeneration_(1:30) special.png 2,13 16499\n 373 Regeneration_II_(0:16) special.png 2,13 16417\n 373 Swiftness_(2:15) special.png 3,13 16386\n 373 Swiftness_(6:00) special.png 3,13 16450\n 373 Swiftness_II_(1:07) special.png 3,13 16418\n 373 Fire_Resistance_(2:15) special.png 4,13 16387\n 373 Fire_Resistance_(2:15) special.png 4,13 16419\n 373 Fire_Resistance_(6:00) special.png 4,13 16451\n 373 Healing special.png 6,13 16389\n 373 Healing special.png 6,13 16453\n 373 Healing_II special.png 6,13 16421\n 373 Strength_(2:15) special.png 8,13 16393\n 373 Strength_(6:00) special.png 8,13 16457\n 373 Strength_II_(1:07) special.png 8,13 16425\n 373 Poison_(0:33) special.png 5,13 16388\n 373 Poison_(1:30) special.png 5,13 16452\n 373 Poison_II_(0:16) special.png 5,13 16420\n 373 Weakness_(1:07) special.png 7,13 16392\n 373 Weakness_(1:07) special.png 7,13 16424\n 373 Weakness_(3:00) special.png 7,13 16456\n 373 Slowness_(1:07) special.png 9,13 16394\n 373 Slowness_(1:07) special.png 9,13 16426\n 373 Slowness_(3:00) special.png 9,13 16458\n 373 Harming special.png 10,13 16396\n 373 Harming special.png 10,13 16460\n 373 Harming_II special.png 10,13 16428\n# Unbrewable:\n 373 Regeneration_II_(0:45) special.png 2,13 16481\n 373 Swiftness_II_(3:00) special.png 3,13 16482\n 373 Strength_II_(3:00) special.png 8,13 16489\n 373 Poison_II_(0:45) special.png 5,13 16484\n\n# Spawn Eggs\n# ID NAME FILE CORDS DAMAGE\n 383 Spawn_Creeper special.png 0,9 50\n 383 Spawn_Skeleton special.png 1,9 51\n 383 Spawn_Spider special.png 2,9 52\n 383 Spawn_Zombie special.png 3,9 54\n 383 Spawn_Slime special.png 4,9 55\n 383 Spawn_Ghast special.png 0,10 56\n 383 Spawn_Zombie_Pigmen special.png 1,10 57\n 383 Spawn_Enderman special.png 2,10 58\n 383 Spawn_Cave_Spider special.png 3,10 59\n 383 Spawn_Silverfish special.png 4,10 60\n 383 Spawn_Blaze special.png 0,11 61\n 383 Spawn_Magma_Cube special.png 1,11 62\n 383 Spawn_Bat special.png 5,9 65\n 383 Spawn_Witch special.png 5,10 66\n 383 Spawn_Pig special.png 2,11 90\n 383 Spawn_Sheep special.png 3,11 91\n 383 Spawn_Cow special.png 4,11 92\n 383 Spawn_Chicken special.png 0,12 93\n 383 Spawn_Squid special.png 1,12 94\n 383 Spawn_Wolf special.png 2,12 95\n 383 Spawn_Mooshroom special.png 3,12 96\n 383 Spawn_Villager special.png 4,12 120\n\n# Groups\n# NAME ICON ITEMS\n# Column 1\n~ Natural 2 2,3,12,24,128,44~1,13,82,79,80,78\n~ Stone 1 1,4,48,67,44~3,139,140,98,109,44~5,44~0,45,108,44~4,101\n~ Wood 5 17,5,53,134,135,136,126,47,85,107,20,102,30\n~ NetherEnd 87 87,88,89,348,112,114,113,372,121,122\n~ Ores 56 16,15,14,56,129,73,21,49,42,41,57,133,22,263~0,265,266,264,388\n~ Special 54 46,52,58,54,130,61,23,25,84,116,379,380,138,146~0,321,389,323,324,330,355,65,96,390,397\n~ Plants1 81 31~1,31~2,106,111,18,81,86,91,103,110\n~ Plants2 6 295,361,362,6,296,338,37,38,39,40,32\n~ Transport 328 66,27,28,328,342,343,333,329,398\n~ Logic 331 331,76,356,69,70,72,131,77,144,33,29,123,137\n~ Wool 35 35~0,35~8,35~7,35~15,35~14,35~12,35~1,35~4,35~5,35~13,35~11,35~3,35~9,35~10,35~2,35~6\n~ Dye 351 351~15,351~7,351~8,351~0,351~1,351~3,351~14,351~11,351~10,351~2,351~4,351~12,351~6,351~5,351~13,351~9\n# Column 2\n~ TierWood 299 298,299,300,301,269,270,271,290,268\n~ TierStone 303 302,303,304,305,273,274,275,291,272\n~ TierIron 307 306,307,308,309,256,257,258,292,267\n~ TierDiam 311 310,311,312,313,277,278,279,293,276\n~ TierGold 315 314,315,316,317,284,285,286,294,283\n~ Tools 261 50,261,262,259,346,359,345,347,395,358,325,326,327,335,384,385,386,387\n~ Food 297 260,322,282,297,360,319,320,363,364,365,366,349,350,354,357,391,396,392,393,394,400\n~ Items 318 280,281,318,337,336,353,339,340,332,376,377,382,381\n~ Drops 341 344,288,334,287,352,289,367,375,341,368,369,370,371,378,399\n~ Music 2257 2256,2257,2258,2259,2260,2261,2262,2263,2264,2265,2266\n# New\n~ Potion 373 373~0,373~16,373~32,373~8192,373~8193,373~8257,373~8225,373~8289,373~8194,373~8258,373~8226,373~8290,373~8195,373~8259,373~8197,373~8229,373~8201,373~8265,373~8233,373~8297,373~8196,373~8260,373~8228,373~8292,373~8200,373~8264,373~8202,373~8266,373~8204,373~8236,373~16384,373~16385,373~16499,373~16417,373~16481,373~16386,373~16450,373~16418,373~16482,373~16387,373~16451,373~16389,373~16421,373~16393,373~16457,373~16425,373~16489,373~16388,373~16452,373~16420,373~16484,373~16392,373~16456,373~16394,373~16458,373~16396,373~16428\n~ Eggs 383 383~50,383~51,383~52,383~54,383~55,383~56,383~57,383~58,383~59,383~60,383~61,383~62,383~65,383~66,383~90,383~91,383~92,383~93,383~94,383~95,383~96,383~120\n\n# Enchantments\n# EID NAME MAX ITEMS\n+ 0 Protection 4 298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317\n+ 1 Fire_Protection 4 298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317\n+ 2 Feather_Falling 4 301,305,309,313,317\n+ 3 Blast_Protection 4 298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317\n+ 4 Projectile_Protection 4 298,299,300,301,302,303,304,305,306,307,308,309,310,311,312,313,314,315,316,317\n+ 5 Respiration 3 298,302,306,310,314\n+ 6 Aqua_Affinity 1 298,302,306,310,314\n+ 16 Sharpness 5 268,272,267,276,283\n+ 17 Smite 5 268,272,267,276,283\n+ 18 Bane_of_Arthropods 5 268,272,267,276,283\n+ 19 Knockback 2 268,272,267,276,283\n+ 20 Fire_Aspect 2 268,272,267,276,283\n+ 21 Looting 3 268,272,267,276,283\n+ 32 Efficiency 5 269,270,271,273,274,275,256,257,258,277,278,279,284,285,286\n+ 33 Silk_Touch 1 269,270,271,273,274,275,256,257,258,277,278,279,284,285,286\n+ 34 Unbreaking 3 269,270,271,273,274,275,256,257,258,277,278,279,284,285,286\n+ 35 Fortune 3 269,270,271,273,274,275,256,257,258,277,278,279,284,285,286\n+ 48 Power 5 261\n+ 49 Punch 2 261\n+ 50 Flame 1 261\n+ 51 Infinity 1 261\n"
  `findItem`(id=0, damage=None)

exception `mceditlib.items.``ItemNotFound`

  Bases: `exceptions.KeyError`

## mceditlib.java module

## mceditlib.levelbase module

Base classes for all Minecraft levels.

class `mceditlib.levelbase.``GetBlocksResult`

  Bases: `tuple`

  GetBlocksResult(Blocks, Data, BlockLight, SkyLight, Biomes)

  `Biomes`

    Alias for field number 4

  `BlockLight`

    Alias for field number 2

  `Blocks`

    Alias for field number 0

  `Data`

    Alias for field number 1

  `SkyLight`

    Alias for field number 3

class `mceditlib.levelbase.``FakeChunkedLevelAdapter`

  Bases: `object`

  FakeChunkedLevelAdapter is an abstract class for implementing fixed size, non-chunked storage formats. Classic, Indev, and Schematic formats inherit from this class. FakeChunkedLevelAdapter has dummy functions for pretending to have Players, Entities and TileEntities. If Entities and TileEntities already present, provides a working `getEntities` and `getTileEntities`.

  FakeChunkedLevelAdapter subclasses must have Width, Length, and Height attributes. Subclasses must also have Blocks, and optionally Data and BlockLight.

  FakeChunkedLevelAdapter implements IWorld and ISectionWorld.

  Required attributes:

  Variables:

  - Height – int
  - Length – int
  - Width – int
  - Blocks – ndarray of any shape, indexed [x, z, y]
  - blocktypes – BlockTypeSet

  Optional attributes:

  Variables:

  - Entities – list or TAG_List
  - TileEntities – list or TAG_List
  - Data – ndarray, same shape and indexes as Blocks
  - BlockLight – ndarray, same shape and indexes as Blocks
  - SkyLight – ndarray, same shape and indexes as Blocks
  - Biomes – ndarray, same x and z sizes as Blocks, indexed [x, z]

  `Blocks` = NotImplemented
  `blocktypes` = NotImplemented
  `Width` = NotImplemented
  `Length` = NotImplemented
  `Height` = NotImplemented
  `hasLights` = False
  `size`
  `bounds`
  `readChunk`(cx, cz, dimName, create=False)

    Creates a FakeChunk object representing the chunk at the given position. Subclasses may choose to override fakeBlocksForChunk and fakeDataForChunk to provide block and blockdata arrays. They may instead override getChunk and return a ChunkBase subclass.

    By default, returns a chunk whose `Blocks` is made from slices of self.Blocks (and `Data` from self.Data if present)

  `writeChunk`(chunk)

    Chunks are references to internal Block arrays (xxx someday transform schematic into internal chunked format and transform it back before write) :param chunk: :type chunk: :return: :rtype:

  `chunkCount`(_)

    Computes an artificial chunk count using self.Width and self.Length.

  `chunkPositions`(_)

    Returns an artificial list of chunk positions using `self.Width` and `self.Length`

  `containsChunk`(cx, cz, _)

    Returns True if the position is within `self.bounds`.

  `fakeBlocksForChunk`(cx, cz)

    Return a Blocks array for a fake chunk at the given position.

    By default, returns a slice of self.Blocks.

    Return type: | ndarray(shape=(16, 16, Height))

  `fakeDataForChunk`(cx, cz)

    Return a Data array for a fake chunk at the given position.

    By default, returns a slice of self.Data if it is present, otherwise returns an array of zeros.

    Return type: | ndarray(shape=(16, 16, Height))

  `fakeEntitiesForChunk`(cx, cz)

    Return the Entities and TileEntities for a fake chunk at the given position.

    By default, returns empty lists.

    Return type: | (list, list)

  `addEntity`(ref)
  `addTileEntity`(ref)
  `getBlockID`(x, y, z)
  `setBlockID`(x, y, z, blockID)
  `getBlockData`(x, y, z)
  `setBlockData`(x, y, z, data)
  `setBlocks`(x, y, z, Blocks=None, Data=None, BlockLight=None, SkyLight=None, Biomes=None, updateLights=True)
  `getBlocks`(x, y, z, return_Blocks=True, return_Data=False, return_BlockLight=False, return_SkyLight=False, return_Biomes=False)
  `getEntities`(selection, **kw)
  `listDimensions`()
  `close`()

class `mceditlib.levelbase.``GenericEntityRef`(rootTag, chunk=None)

  Bases: `object`

  `raw_tag`()
  `dirty`()

class `mceditlib.levelbase.``FakeChunk`

  Bases: `object`

  `dirty` = False
  `dimension` = NotImplemented

    The parent dimension that this chunk belongs to

  `cx` = NotImplemented

    This chunk’s position as a tuple (cx, cz)

  `cz` = NotImplemented

    This chunk’s position as a tuple (cx, cz)

  `Width` = 16
  `Length` = 16
  `dimName` = ''
  `HeightMap` = None
  `Height`
  `bounds`
  `size`
  `sectionPositions`()
  `chunkChanged`(needsLighting=True)

    You are required to call this function after directly modifying any of a chunk’s arrays or its rootTag. Alternately, just set `chunk.dirty = True`

    needsLighting is deprecated; Use the updateLights= argument of setBlocks and other editing functions, or call updateLights(level, x, y, z) to explicitly update lights yourself.

  `blocktypes`
  `getSection`(cy, create=False)

class `mceditlib.levelbase.``FakeSection`

  Bases: `object`

class `mceditlib.levelbase.``LightedChunk`

  Bases: `object`

  Abstract subclass of ChunkBase that provides Anvil and Pocket chunks with an implementation of chunkChanged. This method is called after the Blocks array is accessed directly and takes an optional argument which disables lighting calculation.

  `chunkChanged`(calcLighting=True)

`mceditlib.levelbase.``genSkyLights`(section)

class `mceditlib.levelbase.``BoundsFromChunkPositionsMixin`

  Bases: `object`

  Provides ‘bounds’ and ‘size’ attributes to a level that provides ‘chunkCount’ and ‘chunkPositions’ attributes

  Required attributes:

  Variables:

  - chunkCount – Number of chunks in this world
  - chunkPositions() – Iterator of (cx, cz) tuples

## mceditlib.minecraft_server module

minecraft_server.py

Launches the Minecraft Server to generate chunks in a world. Generates chunks directly into the world, or generates them into a cached temporary world and copies only the requested chunks.

Also downloads the latest minecraft server and stores it in a ~/.mceditlib/ServerJarStorage directory in the user’s home folder. Can check for updates and download them, and can launch user-supplied servers once placed in the storage directory.

Very embarrassing code here.

`mceditlib.minecraft_server.``which`(program)

`mceditlib.minecraft_server.``convert`(text)

`mceditlib.minecraft_server.``alphanum_key`(key)

`mceditlib.minecraft_server.``sort_nicely`(l)

  Sort the given list in the way that humans expect.

class `mceditlib.minecraft_server.``ServerJarStorage`(cacheDir=None)

  Bases: `object`

  `defaultCacheDir` = u'C:\\Users\\Rio\\AppData\\Roaming\\mceditlib\\ServerJarStorage'
  `reloadVersions`()
  `downloadCurrentServer`()
  `cacheNewVersion`(filename, allowDuplicate=True)

    Finds the version number from the server jar at filename and copies it into the proper subfolder of the server jar cache folder

  `jarfileForVersion`(v)
  `checksumForVersion`(v)
  `broken_versions` = ['Beta 1.9 Prerelease 1', 'Beta 1.9 Prerelease 2', 'Beta 1.9 Prerelease 3']
  `latestVersion`
  `getJarfile`(version=None)
  `i` = 3

exception `mceditlib.minecraft_server.``JavaNotFound`

  Bases: `exceptions.RuntimeError`

exception `mceditlib.minecraft_server.``VersionNotFound`

  Bases: `exceptions.RuntimeError`

`mceditlib.minecraft_server.``readProperties`(filename)

`mceditlib.minecraft_server.``saveProperties`(filename, properties)

`mceditlib.minecraft_server.``findJava`()

class `mceditlib.minecraft_server.``MCServerChunkGenerator`(version=None, jarfile=None, jarStorage=None)

  Bases: `object`

  Generates chunks using minecraft_server.jar. Uses a ServerJarStorage to store different versions of minecraft_server.jar in an application support folder.

  > from mceditlib import *

  Example usage:

  > gen = MCServerChunkGenerator() # with no arguments, use the newest
  >   # server version in the cache, or download # the newest one automatically

  > level = loadWorldNamed(“MyWorld”)

  > gen.generateChunkInLevel(level, 12, 24)

  Using an older version:

  > gen = MCServerChunkGenerator(“Beta 1.6.5”)

  `defaultJarStorage` = None
  `javaExe` = 'c:\\Program Files\\Java\\jdk1.7.0_07\\bin\\java.exe'
  `tempWorldCache` = {}
  `jarStorage` = None
  classmethod `getDefaultJarStorage`()
  classmethod `clearWorldCache`()
  `createReadme`()
  `worldCacheDir` = 'c:\\users\\rio\\appdata\\local\\temp\\mceditlib_MCServerChunkGenerator'
  `tempWorldForLevel`(level)
  `generateAtPosition`(tempWorld, tempDir, cx, cz)
  `generateAtPositionIter`(tempWorld, tempDir, cx, cz, simulate=False)
  `copyChunkAtPosition`(tempWorld, level, cx, cz)
  `generateChunkInLevel`(level, cx, cz)
  `minRadius` = 5
  `maxRadius` = 20
  `createLevel`(level, box, simulate=False, **kw)
  `createLevelIter`(level, box, simulate=False, **kw)
  `generateChunksInLevel`(level, chunks)
  `generateChunksInLevelIter`(level, chunks, simulate=False)
  `runServer`(startingDir)
  `lowMemory` = False

## mceditlib.multi_block module

`mceditlib.multi_block.``chunkPosArray`(x, z)

  Construct an array of 8-byte integers made by packing the 4-byte chunk coordinate arrays x and z together.

`mceditlib.multi_block.``decodeChunkPos`(cPos)

`mceditlib.multi_block.``coords_by_chunk`(x, y, z)

  Split the x, y, and z coordinate arrays according to chunk location. Return an iterator over tuples of the chunk’s cx and cz coordinates and arrays of the x y z coordinates located in that chunk.

  Performance note: Implicitly sorts the elements of an intermediate array. May perform better when input arrays are short.

  Parameters:

  - x – Array of x coordinates
  - y – Array of y coordinates
  - z – Array of z coordinates

  Returns: | iterator over (cx, cz, x, y, z) tuples, where x, y, and z are arrays and cx and cz are integers

`mceditlib.multi_block.``getBlocks`(world, x, y, z, return_Blocks=True, return_Data=False, return_BlockLight=False, return_SkyLight=False, return_Biomes=False)

  High performance method for accessing multiple blocks and their lighting info.

  Requires `world` have a `getChunk(cx, cz)` method Requires that method return an object that has a `getBlocks` method that takes the same parameters as this one.

  Return the blocks at the requested locations as one or more ndarrays. Returns a tuple of ndarrays, one for each `return_` parameter with a True value, in the order that the parameters appear. Returns the blocks as raw Block IDs, which you can convert to BlockType instances using world.blocktype

  The `x`, `y`, and `z` parameters must have the same shape.

  Parameters:

  - x – Array of x coordinates
  - y – Array of y coordinates
  - z – Array of z coordinates
  - return_Blocks –
  - return_Data –
  - return_BlockLight –
  - return_SkyLight –
  - return_Biomes –

  Returns: | GetBlocksResult

`mceditlib.multi_block.``getChunkBlocks`(chunk, x, y, z, return_Blocks=True, return_Data=False, return_BlockLight=False, return_SkyLight=False, return_Biomes=False)

  High performance method for accessing multiple blocks and their lighting info.

  Parameters are identical to getBlocks :type x: numpy.ndarray :type y: numpy.ndarray :type z: numpy.ndarray

`mceditlib.multi_block.``getSectionBlocks`(section, x, y, z, return_Blocks=True, return_Data=False, return_BlockLight=False, return_SkyLight=False)

  Return the blocks at the given positions. Returns a list of one or more arrays depending on which `return_*` parameters were passed.

  x, y, z must be in the range 0..15

`mceditlib.multi_block.``maskArray`(array, mask)

`mceditlib.multi_block.``atleast_3d`(ary)

  numpy.atleast_3d adds axes on either side of a 1d array’s axis, but I want the new axes to come afterward. :param ary: :type ary: :return: :rtype:

`mceditlib.multi_block.``setBlocks`(dimension, x, y, z, Blocks=None, Data=None, BlockLight=None, SkyLight=None, Biomes=None, updateLights=True)

  Change the blocks at the given positions. All parameters must be arrays of the same shape, or single values.

`mceditlib.multi_block.``setChunkBlocks`(chunk, x, y, z, Blocks=None, Data=None, BlockLight=None, SkyLight=None, Biomes=None)

  Change the blocks at the given positions. All parameters must be arrays of the same shape, or single values. Chunk must have a `world` attribute and `getSection` function.

`mceditlib.multi_block.``setSectionBlocks`(section, x, y, z, Blocks=None, Data=None, BlockLight=None, SkyLight=None)

  Change the blocks at the given positions. All parameters must be arrays of the same shape, or single values.

  x, y, z must be in the range 0..15

## mceditlib.nbt module

Cython implementation

Named Binary Tag library. Serializes and deserializes TAG_* objects to and from binary data. Load a Minecraft level by calling nbt.load(). Create your own TAG_* objects and set their values. Save a TAG_* object to a file or StringIO object.

Read the test functions at the end of the file to get started.

This library requires Numpy. Get it here: http://new.scipy.org/download.html

Official NBT documentation is here: http://www.minecraft.net/docs/NBT.txt

Copyright 2012 David Rio Vierra

exception `mceditlib.nbt.``NBTFormatError`

  Bases: `exceptions.ValueError`

  Indicates the NBT format is invalid.

class `mceditlib.nbt.``TAG_Byte`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Byte_Array`

  Bases: `mceditlib.nbt.TAG_Value`

  `copy`()
  `dtype` = dtype('uint8')
  `value`

class `mceditlib.nbt.``TAG_Compound`

  Bases: `mceditlib.nbt._TAG_Compound`, `_abcoll.MutableMapping`

class `mceditlib.nbt.``TAG_Double`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Float`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Int`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Int_Array`

  Bases: `mceditlib.nbt.TAG_Value`

  `copy`()
  `dtype` = dtype('>u4')
  `value`

class `mceditlib.nbt.``TAG_List`

  Bases: `mceditlib.nbt._TAG_List`, `_abcoll.MutableSequence`

class `mceditlib.nbt.``TAG_Long`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Short`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Short_Array`

  Bases: `mceditlib.nbt.TAG_Value`

  `copy`()
  `dtype` = dtype('>u2')
  `value`

class `mceditlib.nbt.``TAG_String`

  Bases: `mceditlib.nbt.TAG_Value`

  `value`

class `mceditlib.nbt.``TAG_Value`

  Bases: `object`

  `copy`()
  `isCompound`()
  `isList`()
  `name`
  `tagID`

`mceditlib.nbt.``gunzip`()

`mceditlib.nbt.``hexdump`()

`mceditlib.nbt.``load`()

  Load an NBT tree from a file and return the root TAG_Compound. The root tag is the only tag that can have a name itself without being inside a TAG_Compound. If filename is given, loads NBT data from that file. If buf is given, loads NBT data from the bytes or filehandle. :param filename: Filename to load data from :type filename: basestring :param buf: File-like object to load data from :type buf: file-like object | bytes :return: Structured NBT data :rtype: TAG_Compound

class `mceditlib.nbt.``load_ctx`

  Bases: `object`

`mceditlib.nbt.``nested_string`()

`mceditlib.nbt.``try_gunzip`()

## mceditlib.nbtattr module

${NAME}

class `mceditlib.nbtattr.``NBTAttr`(name, tagType, default=None)

  Bases: `object`

class `mceditlib.nbtattr.``NBTUUIDAttr`

  Bases: `object`

class `mceditlib.nbtattr.``NBTCompoundListAttr`(name, compoundAttrsClass)

  Bases: `object`

class `mceditlib.nbtattr.``NBTListAttr`(name, listType, default=())

  Bases: `object`

class `mceditlib.nbtattr.``CompoundAttrs`(rootTag)

  Bases: `object`

class `mceditlib.nbtattr.``NBTCompoundAttr`(name, attrsClass)

  Bases: `mceditlib.nbtattr.NBTAttr`

class `mceditlib.nbtattr.``NBTVectorAttr`(name, listType, default=())

  Bases: `mceditlib.nbtattr.NBTListAttr`

`mceditlib.nbtattr.``SetNBTDefaults`(ref)

  Given an object whose class has several members of type `NBT[*]Attr`, sets those attributes to their default values.

## mceditlib.pocket module

## mceditlib.relight module

`mceditlib.relight.``unique_chunks`(x, z)

`mceditlib.relight.``updateHeightmap`(dimension, x, y, z)

  Parameters: | dimension (mceditlib.worldeditor.WorldEditorDimension) –
  Returns: |
  Return type: |

`mceditlib.relight.``updateLights`(dimension, x, y, z)

  Parameters: | dimension (mceditlib.worldeditor.WorldEditorDimension) –
  Returns: |
  Return type: |

## mceditlib.revisionhistory module

revisionhistory

class `mceditlib.revisionhistory.``RevisionChanges`

  Bases: `object`

exception `mceditlib.revisionhistory.``UndoFolderExists`

  Bases: `exceptions.IOError`

  Raised when initializing a RevisionHistory and an existing undo folder is found, but no resume mode is given.

class `mceditlib.revisionhistory.``RevisionHistory`(filename, resume=None)

  Bases: `object`

  A history of partial world folders, used to implement disk-backed undo. Each partial folder represents a revision of the initial folder. Reading a file or chunk from the history will first read from the most recent world folder. If it is not found there, proceeds down the history until the requested data is found, and returns its most recent version. Writing a file or chunk will always write to the most recent revision.

  Chunks are read and written as NBT TAG_Compounds. Files are read and written as bytes.

  To begin using the RevisionHistory, call getHead() to get the head (latest) revision of the history as a RevisionHistoryNode. The RevisionHistory is created with the initial world folder as the head node. Call createRevision to create the first revision.

  To get a reference to an earlier revision, call getRevision with the index of the requested revision. For now, calling createRevision on an earlier revision will erase all subsequent revisions. In the future, this may be changed to implement a tree-shaped undo history.

  To write all changes from partial folders into the initial world folder, call writeAllChanges.

  When the RevisionHistory is deleted, all partial folders are removed from disk.

  `close`()

    Close the RevisionHistory and release all resources, including all revisions. Operations on a closed RevisionHistory are undefined. :return: :rtype:

  `createRevision`(previousRevision=None)

    Creates a new partial folder and appends it to the history. If revisionIndex is given, inserts the revision after that position and removes all later revisions. Inserting a revision before the position of any presave folders in the history after calling writeAllChanges will collapse those presave folders into the last presave folder in the new history.

    Subsequent writes are directed to this folder. This function must be called once before performing any edits, otherwise the world is read-only.

    Returns: | The newly created revision node.
    Return type: | RevisionHistoryNode

  `closeRevision`()
  `getHead`()
  `getRevision`(idx)
  `getRevisionChanges`(oldNode, newNode)

    Return all changes that happened after oldNode up to and including those in newNode.

    Returns a RevisionChanges object that lists the chunks that changed by dimension name, and the files that changed. It does not distinguish between files/chunks that are newly created, modified or deleted.

    Parameters:

    - oldNode (int | RevisionHistoryNode) – Index of the node to find changes after, or the node itself.
    - newNode (int | RevisionHistoryNode) – Index of the node to find changes up to and including, or the node itself.

    Returns: |
    Return type: | RevisionChanges

  `writeAllChanges`(requestedRevision=None)

    Write all changes to the root world folder, preserving undo history. The previous head node is no longer valid after calling writeAllChanges. Specify a revision to only save changes up to and including that revision. :return: :rtype:

`mceditlib.revisionhistory.``copyToFolder`(destFolder, sourceNode, presaveNode=None)

class `mceditlib.revisionhistory.``RevisionHistoryNode`(history, worldFolder, parentNode)

  Bases: `object`

  `getChanges`()
  `listDimensions`()

    List the names of all dimensions in this world.

    Returns: |
    Return type: | Iterator of [str]

  `containsChunk`(cx, cz, dimName)

    Return whether the given chunk is present in the given dimension

    Returns: |
    Return type: | bool

  `chunkPositions`(dimName)
  `chunkCount`(dimName)
  `chunkPositionsThisRevision`(dimName)
  `deleteChunk`(cx, cz, dimName)
  `loadDeletedChunks`()

    A list of chunks deleted in this revision that MAY be present in previous revisions :return: :rtype:

  `readChunkBytes`(cx, cz, dimName)
  `writeChunkBytes`(cx, cz, dimName, data)
  `containsFile`(path)
  `deleteFile`(path)
  `loadDeletedFiles`()

    A list of files deleted in this revision that MAY be present in previous revisions :return: :rtype:

  `readFile`(path)

    Read the specified file from the most recent revision containing that file. :param path: :type path: :return: :rtype:

  `writeFile`(path, data)
  `listFolder`(path)

    List the contents of the given folder, reading all previous revisions. Ignores the REVINFO file.

    rev1:
      level.dat some.file
    rev2
      level.dat_old
    rev3
      another.file -some.file
    rev4
      -another.file some.file
    @4 +some.file -another_file
      newFiles some.file files some.file deadFiles anotherFile
    @3 -some.file +another.file
      newFiles files some.file deadFiles anotherFile someFile
    @2 +level.dat_old
      newFiles level.dat_old files some.file level.dat_old deadFiles anotherFile someFile
    @1 +level.dat +some.file
      newFiles level.dat files level.dat level.dat_old some.file deadFiles anotherFile someFile
    expected:
      level.dat level.dat_old some.file

    Parameters: | path –
    Returns: |
    Return type: |

  `REVINFO_FILENAME` = u'##MCEDIT.REVINFO##'
  `getRevisionInfo`()

    Read revision info from a JSON-formatted file for the client’s internal use. Returns None if no revision info is assigned. :return: :rtype: list | dict | str | unicode | int | None

  `setRevisionInfo`(info)

    Write revision info to a JSON-formatted file for the client’s internal use :return: :rtype:

## mceditlib.run_regression_test module

`mceditlib.run_regression_test.``generate_file_list`(directory)

`mceditlib.run_regression_test.``sha1_file`(name, checksum=None)

`mceditlib.run_regression_test.``calculate_result`(directory)

`mceditlib.run_regression_test.``temporary_directory`(*args, **kwds)

`mceditlib.run_regression_test.``directory_clone`(*args, **kwds)

`mceditlib.run_regression_test.``launch_subprocess`(directory, arguments, env=None)

exception `mceditlib.run_regression_test.``RegressionError`

  Bases: `exceptions.Exception`

`mceditlib.run_regression_test.``do_test`(test_data, result_check, arguments=())

  Run a regression test on the given world.

  result_check - sha1 of the recursive tree generated arguments - arguments to give to mce.py on execution

`mceditlib.run_regression_test.``do_test_match_output`(test_data, result_check, arguments=())

`mceditlib.run_regression_test.``main`(argv)

## mceditlib.schematic module

Created on Jul 22, 2011

@author: Rio

`mceditlib.schematic.``createSchematic`(shape, blocktypes='Alpha')

class `mceditlib.schematic.``SchematicFileAdapter`(shape=None, filename=None, blocktypes='Alpha', readonly=False, resume=False)

  Bases: `mceditlib.levelbase.FakeChunkedLevelAdapter`

  `EntityRef`

    alias of `PCEntityRef`

  `TileEntityRef`

    alias of `PCTileEntityRef`

  `blocktypes` = <BlockTypeSet (Alpha)>
  `saveChanges`()
  `saveToFile`(filename)

    save to file named filename.

  `minHeight` = 0
  `getDimensionBounds`(dimName='')
  `maxHeight`
  `Length`
  `Width`
  `Height`
  `Blocks`
  `Data`
  `Materials`
  `Biomes`
  `getPlayer`(*a, **kw)
  `playerNames`()
  `setBlockData`(x, y, z, newdata)
  `getBlockData`(x, y, z)
  classmethod `chestWithItemID`(itemID, count=64, damage=0)

    Creates a chest with a stack of ‘itemID’ in each slot. Optionally specify the count of items in each stack. Pass a negative value for damage to create unnaturally sturdy tools.

  `readChunk`(cx, cz, dimName, create=False)

class `mceditlib.schematic.``INVEditChest`(filename)

  Bases: `mceditlib.levelbase.FakeChunkedLevelAdapter`

  `Width` = 1
  `Height` = 1
  `Length` = 1
  `Data` = array([[[0]]], dtype=uint8, shape=(1L, 1L, 1L))
  `Entities` = <TAG_List name='' list_type=<type 'mceditlib.nbt.TAG_Byte'> length=0>
  `Materials` = <BlockTypeSet (Alpha)>
  `Blocks` = None
  `TileEntities`

class `mceditlib.schematic.``ZipSchematic`(filename, create=False)

  Bases: `mceditlib.anvil.adapter.AnvilWorldAdapter`

  `saveChanges`()
  `saveToFile`(filename)
  `getWorldBounds`()
  classmethod `canOpenFile`(filename)

## mceditlib.worldeditor module

`mceditlib.worldeditor.``string_func`(array)

class `mceditlib.worldeditor.``WorldEditorChunk`(chunkData, editor)

  Bases: `object`

  This is a 16x16xH chunk in a format-independent world. The Blocks, Data, SkyLight, and BlockLight arrays are divided into vertical sections of 16x16x16, accessed using the `getSection` method.

  `buildNBTTag`()
  `bounds`
  `chunkPosition`
  `rootTag`
  `dirty`
  `sectionPositions`()
  `getSection`(cy, create=False)
  `blocktypes`
  `Biomes`
  `HeightMap`
  `TerrainPopulated`
  `addEntity`(ref)
  `addTileEntity`(ref)
  `removeTileEntity`(ref)

class `mceditlib.worldeditor.``WorldEditor`(filename=None, create=False, readonly=False, adapterClass=None, adapter=None, resume=None)

  Bases: `object`

  `requireRevisions`()
  `undo`()
  `redo`()
  `beginUndo`()

    Begin a new undo revision, creating a new revision in the underlying storage chain if an editable revision is not selected. :return: :rtype:

  `commitUndo`(revisionInfo=None)

    Record all changes since the last call to beginUndo into the adapter’s current revision. The revision is closed and beginUndo must be called to open the next revision.

    Parameters: | revisionInfo (object | None) – May be supplied to record metadata for this undo
    Returns: |
    Return type: |

  `undoRevisions`()

    Iterate through all revisions and return (index, revisionInfo) tuples. revisionInfo is the info stored with commitUndo for each revision. Call selectUndoRevision with the index of the desired revision to rewind time.

    Returns: |
    Return type: |

  `gotoRevision`(index)

    Parameters: | index –
    Returns: |
    Return type: |

  `syncToDisk`()

    Write all loaded chunks, player files, etc to disk.

    Returns: |
    Return type: |

  `saveChanges`()
  `close`()

    Unload all chunks and close all open filehandles.

  `loadedChunkLimit` = 400
  `maxHeight`
  `displayName`
  `blocktypes`
  `preloadChunkPositions`()
  `chunkCount`(dimName)
  `chunkPositions`(dimName)

    Iterates over (xPos, zPos) tuples, one for each chunk in the given dimension. May initiate a costly chunk scan.

    Parameters: | dimName (str) – Name of dimension
    Returns: |
    Return type: |

  `getChunk`(cx, cz, dimName, create=False)

    Returns: | Chunk at the given position.
    Return type: | WorldEditorChunk

  `listDirtyChunks`()
  `chunkBecameDirty`(chunk)
  `getRecentDirtyChunks`(dimName)
  `heightMapAt`(x, z, dimName)
  `containsChunk`(cx, cz, dimName)
  `containsPoint`(x, y, z, dimName)
  `createChunk`(cx, cz, dimName)
  `deleteChunk`(cx, cz, dimName)
  `worldSpawnPosition`()

    Return the world’s default spawn position.

  `setWorldSpawnPosition`(pos)

    Change the world’s default spawn position.

    Parameters: | pos – (x, y, z) coordinates

  `listPlayers`()
  `getPlayer`(playerUUID='')
  `createPlayer`(playerName)
  `listDimensions`()
  `getDimension`(dimName='')

    Returns: |
    Return type: | WorldEditorDimension

class `mceditlib.worldeditor.``WorldEditorDimension`(worldEditor, dimName)

  Bases: `object`

  `bounds`

    Returns: |
    Return type: | BoundingBox

  `getWorldBounds`()
  `size`
  `blocktypes`
  `chunkCount`()
  `chunkPositions`()
  `containsChunk`(cx, cz)
  `getChunk`(cx, cz, create=False)

    Returns: |
    Return type: | WorldEditorChunk

  `getChunks`(chunkPositions=None)

    Return type: | iterator

  `createChunk`(cx, cz)
  `deleteChunk`(cx, cz)
  `getRecentDirtyChunks`()
  `getEntities`(selection, **kw)
  `getTileEntities`(selection, **kw)
  `addEntity`(ref)
  `addTileEntity`(ref)
  `copyBlocksIter`(sourceLevel, sourceSelection, destinationPoint, blocksToCopy=None, entities=True, create=False, biomes=False)
  `copyBlocks`(sourceLevel, sourceSelection, destinationPoint, blocksToCopy=None, entities=True, create=False, biomes=False)
  `exportSchematicIter`(selection)
  `exportSchematic`(selection)

    Returns: |
    Return type: | WorldEditor

  `importSchematicIter`(schematic, destPoint)
  `importSchematic`(schematic, destPoint)
  `fillBlocksIter`(box, block, blocksToReplace=(), updateLights=True)
  `fillBlocks`(box, block, blocksToReplace=(), updateLights=True)
  `getBlock`(x, y, z)
  `getBlockID`(x, y, z, default=0)
  `setBlockID`(x, y, z, value)
  `getBlockData`(x, y, z, default=0)
  `setBlockData`(x, y, z, value)
  `getBlocks`(x, y, z, return_Blocks=True, return_Data=False, return_BlockLight=False, return_SkyLight=False, return_Biomes=False)
  `setBlocks`(x, y, z, Blocks=None, Data=None, BlockLight=None, SkyLight=None, Biomes=None, updateLights=True)

## Module contents

### Navigation

- index
- modules |
- next |
- previous |
- mceditlib 0.1 documentation »