Litemapy
Litemapy's goal is to provide an easy to use way to read and edit Litematica's schematic file format
Install / Use
/learn @SmylerMC/LitemapyREADME
Installation
Litemapy is available on pypi:
pip install litemapy
Features:
- Read and write .litematic files
- Full support for litematics' regions concept
- Full block storage support
- Full support for basic metadata handling (author, name, description, block count and total volume)
- Partial support for entities
- Partial support for tile entities
- Partial support for pending block updates
- Partial support for preview images
Documentation
Documentation is available on ReadTheDocs: litemapy.rtfd.io.
Example
Here is a basic example of creating a schematic, and of reading one:
from litemapy import Schematic, Region, BlockState
# Shortcut to create a schematic with a single region
reg = Region(0, 0, 0, 21, 21, 21)
schem = reg.as_schematic(name="Planet", author="SmylerMC", description="Made with litemapy")
# Create the block state we are going to use
block = BlockState("minecraft:light_blue_concrete")
# Build the planet
for x, y, z in reg.block_positions():
if round(((x-10)**2 + (y-10)**2 + (z-10)**2)**.5) <= 10:
reg[x, y, z] = block
# Save the schematic
schem.save("planet.litematic")
# Load the schematic and get its first region
schem = Schematic.load("planet.litematic")
reg = list(schem.regions.values())[0]
# Print out the basic shape
for x in reg.xrange():
for z in reg.zrange():
b = reg[x, 10, z]
if b.id == "minecraft:air":
print(" ", end="")
else:
print("#", end='')
print()
When ran, we get the expected output:
#######
###########
#############
###############
#################
###################
###################
#####################
#####################
#####################
#####################
#####################
#####################
#####################
###################
###################
#################
###############
#############
###########
#######
Related Skills
node-connect
347.0kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
107.8kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
347.0kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
347.0kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
