Litematica to WorldEdit¶
Convert two workshops in a Java 1.21.1 Litematica file to one WorldEdit .schem.
The input has main at the origin and annex offset by ten blocks. Flattening
keeps their relative placement while discarding the region boundaries; the
script asks you to accept that loss before saving.
Check the export¶
Download convert.py and workshop-regions.litematic into the same directory. With uv installed, run:
uv run --with mcschemora convert.py workshop-regions.litematic output/workshops.schem --flatten
The check reports two losses and stops before writing:
Edition: java; version: 1.21.1
Regions: annex, main
Loss: Destination stores one region; region names and boundaries will be lost
Loss: main: omitted structure cells become explicit air in schem
Export blocked; resolve errors or explicitly accept the reported losses.
To accept the loss of region boundaries and the conversion of omitted cells to explicit air, rerun with the loss flag:
uv run --with mcschemora convert.py workshop-regions.litematic output/workshops.schem --flatten --allow-loss
The command saves output/workshops.schem; compare it with the
verified output. If region
bounds overlap, resolve that error first. --allow-loss only accepts losses.
Put the result in WorldEdit's configured schematics directory, load it with
//schem load workshops, and paste at the intended location. See
Minecraft import instructions for paths
and importer compatibility.
Export checks¶
The script calls check_export(format="schem", flatten=True) before saving.
Errors block writing, and losses require explicit acceptance. The output
extension selects Sponge v3; legacy MCEdit .schematic conversion is unsupported.
import argparse
from pathlib import Path
from mcschemora import Schematic
def main():
parser = argparse.ArgumentParser(description="Inspect and convert a schematic.")
parser.add_argument("source", type=Path)
parser.add_argument("destination", type=Path)
parser.add_argument("--version", help="Target Minecraft Java version")
parser.add_argument("--flatten", action="store_true")
parser.add_argument("--allow-loss", action="store_true")
args = parser.parse_args()
schematic = Schematic.load(args.source)
print(f"Edition: {schematic.edition}; version: {schematic.version}")
print(f"Regions: {', '.join(schematic.regions)}")
format_name = (
"blueprint" if args.destination.suffix == ".wiki" else args.destination.suffix.lstrip(".")
)
report = schematic.check_export(format=format_name, version=args.version, flatten=args.flatten)
print(report)
if report.errors or (report.losses and not args.allow_loss):
raise SystemExit("Export blocked; resolve errors or explicitly accept the reported losses.")
args.destination.parent.mkdir(parents=True, exist_ok=True)
schematic.save(
args.destination, version=args.version, flatten=args.flatten, allow_loss=args.allow_loss
)
print(f"Saved {args.destination.name}")
if __name__ == "__main__":
main()
Use files and conversion for version changes, retained payloads, and codec choices. To convert a directory with a report for each input, continue with batch conversion.