Skip to content

Instantly share code, notes, and snippets.

@JackNoordhuis
Forked from TruDan/PC2PE.py
Last active August 30, 2016 11:35
Show Gist options
  • Save JackNoordhuis/d6651f84dde7feb7f719103754631be8 to your computer and use it in GitHub Desktop.
Save JackNoordhuis/d6651f84dde7feb7f719103754631be8 to your computer and use it in GitHub Desktop.
MCEdit Filter to convert PC worlds to PE. Note: This does NOT convert the world to MCRegion format.
displayName = "PC -> PE"
replaceBlocks = {
119: 0, # End portal frame
122: 0, # Dragon egg
125: 157, # Double wooden slab
126: 158, # Wooden slab
130: 54, # Enderchest
137: 0, # Command block
138: 0, # Beacon
160: 102, # Stained glass panes
166: 0, # Barrier
168: 0, # Prismarine
169: 0, # Sea lantern
}
def perform(level, box, options):
for x in xrange(box.minx, box.maxx):
for y in xrange(box.miny, box.maxy):
for z in xrange(box.minz, box.maxz):
blockid = level.blockAt(x, y, z)
try:
newid = replaceBlocks[blockid]
except IndexError:
pass
else:
level.setBlockAt(x, y, z, newid)
return;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment