if output_dir is None: output_dir = mcpack_path.stem + "_extracted"
tk.Label(root, text="MCPack Converter for Minecraft Bedrock", font=("Arial", 14)).pack(pady=10) # Input frame = tk.Frame(root) frame.pack(pady=5) tk.Label(frame, text="File/Folder:").pack(side=tk.LEFT) self.path_var = tk.StringVar() tk.Entry(frame, textvariable=self.path_var, width=50).pack(side=tk.LEFT, padx=5) tk.Button(frame, text="Browse", command=self.browse).pack(side=tk.LEFT) # Buttons btn_frame = tk.Frame(root) btn_frame.pack(pady=10) tk.Button(btn_frame, text="Extract .mcpack", command=lambda: self.run("--extract")).pack(side=tk.LEFT, padx=5) tk.Button(btn_frame, text="Pack to .mcpack", command=lambda: self.run("--pack")).pack(side=tk.LEFT, padx=5) tk.Button(btn_frame, text="→ .zip", command=lambda: self.run("--tozip")).pack(side=tk.LEFT, padx=5) tk.Button(btn_frame, text="← .mcpack", command=lambda: self.run("--tomcpack")).pack(side=tk.LEFT, padx=5) tk.Button(btn_frame, text="Extract All", command=lambda: self.run("--extract-all")).pack(side=tk.LEFT, padx=5) # Output log self.log = scrolledtext.ScrolledText(root, height=15) self.log.pack(fill=tk.BOTH, expand=True, padx=10, pady=10) mcpack converter
zip_path = mcpack_path.with_suffix('.zip') mcpack_path.rename(zip_path) print(f"✅ Converted to: {zip_path}") return True def convert_to_mcpack(zip_path): """Rename .zip to .mcpack""" zip_path = Path(zip_path) if not zip_path.exists(): print(f"❌ File not found: {zip_path}") return False if output_dir is None: output_dir = mcpack_path
python mcpack_gui.py
Run GUI with:
output_dir = Path(output_dir) output_dir.mkdir(exist_ok=True) text="MCPack Converter for Minecraft Bedrock"