Restyle a workshop¶
Change the workshop's oak pillars and slabs to birch and its stone-brick floor to deepslate bricks with a reusable JSON profile. The supplied profile changes 110 blocks while keeping the bed, furnace, and inventory chest. Compatible states, including vertical log axes and bottom-slab placement, survive the restyle.
Profile¶
Save restyle.py, workshop_palette.json, and workshop.schem together. Review the profile before running it:
{
"edition": "java",
"keep": ["minecraft:chest", "minecraft:furnace", "minecraft:red_bed"],
"replacements": [
{"from": ["minecraft:oak_log"], "to": "minecraft:birch_log"},
{"from": ["minecraft:oak_slab"], "to": "minecraft:birch_slab"},
{"from": ["minecraft:stone_bricks"], "to": "minecraft:deepslate_bricks"}
]
}
IDs listed in keep are protected. Each replacement group changes its source
IDs to the target; with fallback omitted, every other material stays unchanged.
Normalization retains compatible properties across orientations. Run the profile
against the supplied workshop:
uv run --with mcschemora restyle.py workshop.schem workshop_palette.json --output output/restyled
Validation prints No issues found. and the changed count is 110. The script
leaves the source unchanged and writes before.png, after.png,
restyled.litematic, and comparison.json. Compare the changed count and the
before/after palette counts to find any skipped replacements.
Rendering downloads visual assets on first use and uses the shared Java 1.21.6 visual bundle; check its diagnostics when trying other inputs.
Script¶
The script calculates the original costs and renders a cutaway before applying the profile. It then validates, calculates the new costs, and exports the separate build and preview. Adjust the Y=0..3 crop when using a build with a different roof height:
import argparse
import json
from pathlib import Path
from mcschemora import Schematic
def main():
parser = argparse.ArgumentParser(
description="Apply a material profile and compare build costs."
)
parser.add_argument("source", type=Path)
parser.add_argument("profile", type=Path)
parser.add_argument("--output", type=Path, default=Path("output/restyled"))
args = parser.parse_args()
if args.source.resolve().parent == args.output.resolve():
parser.error("Choose an output directory separate from the input file.")
scene = Schematic.load(args.source, max_unpacked_bytes=64 * 1024 * 1024)
before = {
"materials": scene.material_cost(),
"values": {profile: scene.value_cost(profile) for profile in ("emc", "essentialsx")},
}
args.output.mkdir(parents=True, exist_ok=True)
before_diagnostics = scene.export_png(args.output / "before.png", size=(800, 600), y=(0, 3))
changes = scene.normalize(args.profile)
validation = scene.validate()
print(validation)
if validation.errors:
raise SystemExit("Resolve validation errors before saving the restyled build.")
after = {
"materials": scene.material_cost(),
"values": {profile: scene.value_cost(profile) for profile in ("emc", "essentialsx")},
}
scene.save(args.output / "restyled.litematic")
after_diagnostics = scene.export_png(args.output / "after.png", size=(800, 600), y=(0, 3))
report = {
"before": before,
"after": after,
"changes": changes,
"import_diagnostics": scene.import_diagnostics,
"render_diagnostics": {"before": before_diagnostics, "after": after_diagnostics},
}
(args.output / "comparison.json").write_text(json.dumps(report, indent=2) + "\n")
print(f"Replaced {changes['changed']} blocks")
for profile in ("emc", "essentialsx"):
previous = before["values"][profile]
current = after["values"][profile]
print(f"{profile}: {previous['total']} -> {current['total']}")
print(f"Unpriced before: {previous['unpriced']}; after: {current['unpriced']}")
print(f"Render diagnostics: {report['render_diagnostics']}")
print(f"Saved build, previews, and comparison to {args.output}")
if __name__ == "__main__":
main()
Continue with compare palette costs to interpret the report, or read about custom profiles and rule precedence to change how materials are selected.

Download the restyled schematic and comparison report to inspect the result.