Mcpack Converter - [exclusive]
if output_dir is None: output_dir = mcpack_path.stem + "_extracted"
import os import zipfile import shutil import json import argparse from pathlib import Path def extract_mcpack(mcpack_path, output_dir=None): """Extract .mcpack file to a folder""" mcpack_path = Path(mcpack_path) if not mcpack_path.exists(): print(f"❌ File not found: {mcpack_path}") return False mcpack converter
for mcpack in mcpack_files: print(f"\n📦 Processing: {mcpack.name}") extract_mcpack(mcpack, directory / mcpack.stem) def main(): parser = argparse.ArgumentParser(description="MCPack Converter for Minecraft Bedrock") parser.add_argument("path", help="Path to .mcpack file or folder") parser.add_argument("--extract", "-e", action="store_true", help="Extract .mcpack to folder") parser.add_argument("--pack", "-p", action="store_true", help="Pack folder to .mcpack") parser.add_argument("--tozip", "-z", action="store_true", help="Convert .mcpack to .zip (rename only)") parser.add_argument("--tomcpack", "-m", action="store_true", help="Convert .zip to .mcpack (rename only)") parser.add_argument("--extract-all", "-ea", action="store_true", help="Extract all .mcpack files in directory") if output_dir is None: output_dir = mcpack_path