Skip to main content

pyCraft

Minecraft Python 客户端库!

本项目旨在成为一个现代化的、兼容 Python 3 的、文档完善的库,用于与 Minecraft 服务器进行通信。

开发者详细信息请参阅:<http://pycraft.readthedocs.org/en/latest/>

Because66666 接手该项目后,通过参考开源库

使用Kimi-K3模型完成原代码仓库的协议升级。

start.py 是一个使用该库的无头客户端(headless client)基础示例,使用 start.py --help 查看选项。

详细的使用教程与示例请参见:教程示例

支持的 Minecraft 版本

pyCraft 兼容以下 Minecraft 正式版本:

  • 1.8, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.8.8, 1.8.9
  • 1.9, 1.9.1, 1.9.2, 1.9.3, 1.9.4
  • 1.10, 1.10.1, 1.10.2
  • 1.11, 1.11.1, 1.11.2
  • 1.12, 1.12.1, 1.12.2
  • 1.13, 1.13.1, 1.13.2
  • 1.14, 1.14.1, 1.14.2, 1.14.3, 1.14.4
  • 1.15, 1.15.1, 1.15.2
  • 1.16, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5
  • 1.17, 1.17.1
  • 1.18, 1.18.1, 1.18.2
  • 1.19, 1.19.1, 1.19.2, 1.19.3, 1.19.4
  • 1.20, 1.20.1, 1.20.2, 1.20.3, 1.20.4, 1.20.5, 1.20.6
  • 1.21, 1.21.1, 1.21.2, 1.21.3, 1.21.4, 1.21.5, 1.21.6, 1.21.7, 1.21.8, 1.21.9, 1.21.10, 1.21.11

此外,还支持部分开发快照(snapshot)和预发布版本。 minecraft/__init__.py 中包含完整的受支持 Minecraft 版本列表及对应的协议版本号。

支持的功能

虽然 pyCraft 可以兼容任何受支持的服务器,但目前库中仅实现了解码/编码全部数据包中的一个子集:保持服务器连接所必需的数据包、用于聊天的数据包,以及其他一些数据包。

请注意,聊天消息签名(Minecraft 1.19 引入)已支持:当认证令牌带有聊天签名证书时(MicrosoftAuthenticationTokenauthenticate() 时传入 fetch_certificates=True),发出的聊天消息会自动签名,因此设置了 enforce-secure-chat=true 的服务器也能正常聊天。未获取证书时,聊天消息仍以未签名方式发送,适用于离线模式(offline-mode)服务器和不强制安全聊天的服务器。

希望使用其他功能的开发者可以通过以下方式贡献代码:为所需的数据包实现数据包类,将它们添加到 minecraft/networking/packets 目录下,并提交 Pull Request。

支持的 Python 版本

pyCraft 兼容(至少)以下 Python 实现:

  • Python 3.5
  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • PyPy

依赖要求

这些依赖也记录在 setup.py 中。

cryptography 库的安装说明请参阅:<https://cryptography.io/en/latest/installation/>, 基本上执行 pip install -r requirements.txt 即可安装所有依赖。

联系方式

本项目目前由 Because66666 进行维护,继承项目:ammaraskar/pyCraft

GitHub

首选的沟通方式是通过本项目的 GitHub 页面。

邮件

可以通过邮件联系:

Download files

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

Source Distribution

pycraft_minecraft-0.7.1.tar.gz (136.7 kB view details)

Uploaded Source

Built Distribution

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

pycraft_minecraft-0.7.1-py3-none-any.whl (100.1 kB view details)

Uploaded Python 3

File details

Details for the file pycraft_minecraft-0.7.1.tar.gz.

File metadata

  • Download URL: pycraft_minecraft-0.7.1.tar.gz
  • Upload date:
  • Size: 136.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.9

File hashes

Hashes for pycraft_minecraft-0.7.1.tar.gz
Algorithm Hash digest
SHA256 3c091e10e62b31d711a9a10002110af883acca2354454e82f0d35220fc835b60
MD5 ed6442635b43703352c47c5c290a55fe
BLAKE2b-256 f5213d909954cc46c58a28df14ebe2cb45d2b6effec169ff82cd0ac660186be4

See more details on using hashes here.

File details

Details for the file pycraft_minecraft-0.7.1-py3-none-any.whl.

File metadata

File hashes

Hashes for pycraft_minecraft-0.7.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ad962f14f74b7f548ab2c023c6236d56ff8b81fbaf05cd3f0b526876aea354b1
MD5 e063fafdc7319e3f7b0174d07d9e41d1
BLAKE2b-256 639720f143f47b860d2373b9e3b4b6bc902dc1ab79455bd4ab525ae51c9a970b

See more details on using hashes here.

Release history Release notifications | RSS feed

0.7.3

2 files

0.7.2

2 files

This release

0.7.1 This release

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page