一个用于将 Modrinth 整合包(.mrpack)打包成 Minecraft 服务端的 Python 脚本。
.mrpack 文件,提取 modrinth.index.json 和覆盖文件。env.server 字段或 API 查询跳过仅客户端模组。python modrinth_server_packer.py <modpack_file> [--output OUTPUT_DIR]
<modpack_file>:Modrinth 整合包文件路径(.mrpack)。--output 或 -o:输出目录(可选)。如果未指定,将自动生成 output_server/<整合包名称>。
脚本已打包为单个可执行文件,无需安装 Python 或依赖库。下载 modrinth_server_packer.exe
并直接运行。
modrinth_server_packer.exe <modpack_file> [--output OUTPUT_DIR]
# 使用自动输出目录
python modrinth_server_packer.py "modpack"
# 或使用可执行文件
modrinth_server_packer.exe "modpack"
# 指定输出目录
python modrinth_server_packer.py "modpack" --output my_server
modrinth_server_packer.exe "modpack" --output my_server
输出目录将包含:
forge-<version>-installer.jar 或对应的安装器 JAR。mods/:过滤后的服务端/通用模组。config/、global_packs/ 等:从覆盖文件复制的配置和资源。start.bat 和 start.sh:启动脚本(如果获得了服务器 JAR)。requests 库tqdm 库安装依赖:
pip install -r requirements.txt