Skip to main content

OrzMC

A tool for deploying minecraft client and server

Only supports Python >=2.7, <4

Requires JDK 1.8 to be configured, not higher than this version, becuase forge cannot run on higher jdk versions such as 1.12!

Supported Minecraft Client Version

  • supports versions of client >= 1.13

  • you should make sure the version of the minecraft server that you will connect to is the same as that of the client.

  • This Program has been uploaded into PyPI

Supported Operating System

  • mainly for MacOS.
  • If your operating system is Linux or windows, there is another launcher which is beautiful and flexable: HMCL, you can use it play this game.

Usage

orzmc -h to check the help info

$ orzmc -h

   NAME

        orzmc -- A command line tool for start minecraft client or deploy minecraft server

    Usage

        orzmc [-v client_version_number] [-u username] [-h]

            -s, --server
                deploy minecraft server, if there is no this flag, this command line tool start minecraft as default

            -v, --version  
                Specified the Minecraft clinet version number to start

            -u, --username 
                pick an username for player when start the client

            -t, --game_type
                Specified the type of game: "pure"/"spigot"/"forge" for server, "pure/forge" for client

            -m, --mem_min
                Specified the JVM initial memory allocation

            -x, --mem_max
                Specified the JVM max memory allocation

            -V, --Verbose
                Output some debug info for bugfix

            -h, --help 
                show the command usage info

            -f, --forceUpgrade
                when deploy spigot server, the option can upgrade your map from old game version

            -b, --backup
                backup your minecraft world into ~/minecraft_world_backup directory as zip file!

Run Client

run the pure client normally with latest version and default username

$ pip install orzmc
$ orzmc

if you know the client version and your username

$ pip install orzmc
$ orzmc -v 1.14.2 -u player_name

you can also run the forge client

$ pip install orzmc
$ orzmc -t forge

Deploy Server

use default setting to deploy the pure server

default set jvm initial memory alloc 512M, and max memory alloc 2G

$ pip install orzmc
$ orzmc -s

you can specify the initial memory and max memory alloced for the jvm with options -s and -x to run the minecraft server

$ pip install orzmc
$ orzmc -s -m 512M -x 2G -v 1.14.2

you can also deploy the spigot/forge minecraft server with option -t

Spigot Server

you should installed jre and git tools before you run commands below.

$ pip install orzmc
$ orzmc -s -t spigot -m 512M -x 1G -v 1.14.2

Forge Server

$ pip install orzmc
$ orzmc -s -t forge -m 512M -x 1G -v 1.14.2

由于Forge包是用JDK 8编译的,所以建安装的JDK环境为JDK8系统,不要太高,目前不兼容,会出现无法部署Forge服务器的情况。


The game resources are saved under user's home directory, and named .minecraft

This is not a game for one player, so you should invit someone you like to make you guys own beautiful world!!!

TODO List

  • fire an weixin public account and group for uses get newest information and communicate with each other
  • implement RCON Protocol for remote control Minecraft Server
  • add world backup function
  • refine the project script for readable
  • automation the process of installing JDK/JRE Runtime
  • add some unit test case to guarantee quality
  • create a Docker Mojang Mirror Server for personal CDN

Done List

  • add Spigot Server deploy option
  • add a homepage for this project
  • support forge client and server on MacOS, Yep!!!🤪
  • backup your world map files

Reference

Tips

  • 制作资源包,压缩是要在assets同级目录选择所有文件,而不是在父目录下压缩, 先进入assets目录下面, 再执行指令zip -r resourcepack.zip ./*生成压缩文件, 可以导出作为资源包使用. 查看资源包的SHA-1值使用: echo -e "SHA-1: " "$(shasum -b resourcepack.zip | cut -d ' ' -f 1)"
  • 使用query协议查询服务器状态需要用到UDP协议,所以在云服务器上部署需要允许这个协议访问对应的端口

关于Mac上玩时,无线网络总是断开重连的总题解决方案

这个可能是因为网络问题, minecraft的bug列表中可以搜索到这个问题: MC-98598,提供了解决方案: JVM启动参数中指定使用IPv4: -Djava.net.preferIPv4Stack=true

测试你的服务器可以支持几个玩家同时在线

安装服务器网速测试工具speedtest-cli, 并测速:

$ pip install speedtest-cli
$ speedtest-cli

将得到的上下行网速填入下面网址对应页面的区域时, 并将服务器的内存大小也填入, 开始计算即可

测试网址

Spigot服务器支持将低版本游戏的地图更新到新版本

只需要在启动命令中添加 --forceUpgrade 选项,启动一次服务器地图更新后,启动服务器就不需要添加这个选项了。

Spigot的地图文件有三个目录:

  • world 对应纯净服的主世界地图目录: world
  • world_nether 对应纯净服的下界地图: world/DIM-1
  • world_the_end 对应纯净服的末路之地地图: world/DIM1

从纯净服迁移到Spigot服时,将对应文件夹复制到对应目录下,重启服务即可完成地图迁移。

为服务器添加自定义图标

在服务器启动根目录下面(也就是和jar文件同一级目录下面), 放置64x64大小的png图片, 然后重新启动服务器. 这时再连接服务器时, 就会把自定义的64x64的图片展示出来.

添加自定义音乐播放

mp3转ogg指令: ffmpeg -i origin.mp3 -map 0:a:0 output.ogg

资源包目录定义:

├── assets
│   └── minecraft
│       ├── sounds
│          └── music
│              └── joker
│                  └── joker.ogg
│       ├── sounds.json
│       └── textures
│           └── entity
│               ├── alex.png
│               └── steve.png
├── pack.mcmeta
└── pack.png

只需要在minecraft目录下创建sounds目录,用来存放声音文件ogg格式, 并且要确保播放的声音通道是音频通道的第一个通道. 然后创建同目录级别的sounds.json文件, 用来定义声音文件和游戏中声音事件的对应关系.

{
    "music.joker": {
        "sounds": [
          {
            "name": "music/joker/joker",
            "stream": true,
            "volume": 1
          }
        ]
      }
}

如上, 定义了一个游戏声音事件music.joker, 它使用声音文件: music/joker/joker, 在游戏内, 可以使用指令/playsound 进行播放, 如果和命令方法配合使用, 则可以有其它的好玩的用法. ;-D

添加了Spigot服务systemd服务脚本

scripts/systemd/
└── minecraft.service

0 directories, 1 file

部署时将minecraft.service文件放入/etc/systemd/system/目录下面, 运行命令:

$ sudo systemctl daemon-reload    // 加载服务脚本
$ sudo systemctl start minecraft  // 启动服务
$ sudo systemctl stop minecraft   // 停止服务
$ sudo systemctl reload minecraft // 重新加载游戏

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

OrzMC-1.0.28.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

OrzMC-1.0.28-py2.py3-none-any.whl (24.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file OrzMC-1.0.28.tar.gz.

File metadata

  • Download URL: OrzMC-1.0.28.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for OrzMC-1.0.28.tar.gz
Algorithm Hash digest
SHA256 4cb7af808343c9083d0a4fbe447424b7e22bd120b2eb03caae4ab05b268631a6
MD5 552df49a2bd3c56c8c1c3e6497e72b36
BLAKE2b-256 f2a1f64b5aeb6e03bc3f1615f90e8f65dcafd8b62fe434fcff4198dfcfd41bf8

See more details on using hashes here.

File details

Details for the file OrzMC-1.0.28-py2.py3-none-any.whl.

File metadata

  • Download URL: OrzMC-1.0.28-py2.py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/2.7.10

File hashes

Hashes for OrzMC-1.0.28-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 6a53fb4ef5dd146ec68bbb870e1e1a0a6fbe84de20585d8545d9ae277caffb64
MD5 d2f381255efa5bc968e6d87af7306883
BLAKE2b-256 e30c6dc36bb8acc2ed8581a85ab995b9a9f6bd2697c81b8c81b2a334a2a1d654

See more details on using hashes here.

Release history Release notifications | RSS feed

2.0.1

2 files

2.0.0

2 files

1.0.118

2 files

1.0.113

2 files

1.0.111

2 files

1.0.109

2 files

1.0.108

2 files

1.0.104

2 files

1.0.103

2 files

1.0.102

2 files

1.0.101

2 files

1.0.100

2 files

1.0.99

2 files

1.0.97

2 files

1.0.96

2 files

1.0.95

2 files

1.0.92

2 files

1.0.91

2 files

1.0.90

2 files

1.0.89

2 files

1.0.88

2 files

1.0.87

2 files

1.0.85

2 files

1.0.84

2 files

1.0.83

2 files

1.0.82

2 files

1.0.81

2 files

1.0.80

2 files

1.0.79

2 files

1.0.78

2 files

1.0.77

2 files

1.0.75

2 files

1.0.74

2 files

1.0.73

2 files

1.0.72

2 files

1.0.71

2 files

1.0.70

2 files

1.0.69

2 files

1.0.68

2 files

1.0.66

2 files

1.0.63

2 files

1.0.62

2 files

1.0.61

2 files

1.0.59

2 files

1.0.58

2 files

1.0.57

2 files

1.0.55

2 files

1.0.53

2 files

1.0.52

2 files

1.0.50

2 files

1.0.49

2 files

1.0.48

2 files

1.0.46

2 files

1.0.45

2 files

1.0.44

2 files

1.0.43

2 files

1.0.42

2 files

1.0.41

2 files

1.0.40

2 files

1.0.38

2 files

1.0.37

2 files

1.0.36

2 files

1.0.35

2 files

1.0.34

2 files

1.0.33

2 files

1.0.32

2 files

1.0.31

2 files

1.0.30

2 files

1.0.29

2 files

This release

1.0.28 This release

2 files

1.0.27

2 files

1.0.26

2 files

1.0.25

2 files

1.0.24

2 files

1.0.23

2 files

1.0.22

2 files

1.0.21

2 files

1.0.20

2 files

1.0.19

2 files

1.0.18

2 files

1.0.17

2 files

1.0.16

2 files

1.0.15

2 files

1.0.14

2 files

1.0.13

2 files

1.0.12

2 files

1.0.11

2 files

1.0.10

2 files

1.0.9

2 files

1.0.8

2 files

1.0.7

2 files

1.0.6

2 files

1.0.5

2 files

1.0.4

2 files

1.0.3

2 files

1.0.2

2 files

1.0.1

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page