mymcp


Namemymcp JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryProtocols of Minecraft version 1.21.4 Encode/Decode in Python.
upload_time2025-02-09 15:42:07
maintainerNone
docs_urlNone
authorNone
requires_python>=3.12
licenseNone
keywords minecraft protocols game
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # MYMCP V0.1.1

## MY Minecraft Protocols/Proxy

Encode and decode the protocols of Minecraft (Java Edition) version 1.21.4 in Python. (>90%)

A demo proxy server has been provided.

More Details see [wiki.vg](https://minecraft.wiki/w/Java_Edition_protocol)


## Install
`pip install mymcp`

[twisted](https://twisted.org) is need when use proxy server.

`pip install twisted`

## HowTo
1. Set up a [**minecraft server**](https://www.minecraft.net/en-us/download/server) (java edition) with version 1.21.4 
2. Set **online-mode=false** in **server.propertie** then start the server
3. Install `twisted` before run proxy server
4. Create your own probe and run
```python
from mymcp.protocols import *
from mymcp.protocols import ProtocolEnum as PE
from mymcp.proxy import Probe, Proxy


class MyProbe(Probe):
    """
        Probe Demo
    """
    def play_protocol(self, direct, protocol_cls, data_packet: DataPacket):
        # Create a protocol filter
        if protocol_cls not in (
                PlayProtocols.Client2Server.CSPlayChatMessage,
                PlayProtocols.Server2Client.SCPlayPlayerChatMessage
        ):
            return

        # Do what you want
        print(f"{protocol_cls.__name__:<30} > {protocol_cls.decode(data_packet.bytes_io())}")

# Start A Proxy Server
Proxy(server_host='minecraft_server_host', server_port=25565, proxy_port=25566, probe_cls=MyProbe).run()

```
5. Open a minecraft client, connect to 127.0.0.1:25566 (_proxy_port_ your set before)
6. Say something, and you will see the data in console (ChatMessage Protocol)


## DECLARE

This project is intended for educational purposes (graphics, sound, AI training, etc.) or just for fun.

**ATTENTION PLEASE:**

**NEVER** use this project for illegal or criminal activities.

The author and this project are not responsible for any related consequences resulting from the above usage, and you should use it at your own discretion.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mymcp",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.12",
    "maintainer_email": null,
    "keywords": "Minecraft, Protocols, Game",
    "author": null,
    "author_email": "Me2sY <me2sy@outlook.com>",
    "download_url": "https://files.pythonhosted.org/packages/8e/0b/da0e97bd31cbe81a3fc5e98be86a275c6f94bd94e5e086253fe2a3e2a7e1/mymcp-0.1.1.tar.gz",
    "platform": null,
    "description": "# MYMCP V0.1.1\r\n\r\n## MY Minecraft Protocols/Proxy\r\n\r\nEncode and decode the protocols of Minecraft (Java Edition) version 1.21.4 in Python. (>90%)\r\n\r\nA demo proxy server has been provided.\r\n\r\nMore Details see [wiki.vg](https://minecraft.wiki/w/Java_Edition_protocol)\r\n\r\n\r\n## Install\r\n`pip install mymcp`\r\n\r\n[twisted](https://twisted.org) is need when use proxy server.\r\n\r\n`pip install twisted`\r\n\r\n## HowTo\r\n1. Set up a [**minecraft server**](https://www.minecraft.net/en-us/download/server) (java edition) with version 1.21.4 \r\n2. Set **online-mode=false** in **server.propertie** then start the server\r\n3. Install `twisted` before run proxy server\r\n4. Create your own probe and run\r\n```python\r\nfrom mymcp.protocols import *\r\nfrom mymcp.protocols import ProtocolEnum as PE\r\nfrom mymcp.proxy import Probe, Proxy\r\n\r\n\r\nclass MyProbe(Probe):\r\n    \"\"\"\r\n        Probe Demo\r\n    \"\"\"\r\n    def play_protocol(self, direct, protocol_cls, data_packet: DataPacket):\r\n        # Create a protocol filter\r\n        if protocol_cls not in (\r\n                PlayProtocols.Client2Server.CSPlayChatMessage,\r\n                PlayProtocols.Server2Client.SCPlayPlayerChatMessage\r\n        ):\r\n            return\r\n\r\n        # Do what you want\r\n        print(f\"{protocol_cls.__name__:<30} > {protocol_cls.decode(data_packet.bytes_io())}\")\r\n\r\n# Start A Proxy Server\r\nProxy(server_host='minecraft_server_host', server_port=25565, proxy_port=25566, probe_cls=MyProbe).run()\r\n\r\n```\r\n5. Open a minecraft client, connect to 127.0.0.1:25566 (_proxy_port_ your set before)\r\n6. Say something, and you will see the data in console (ChatMessage Protocol)\r\n\r\n\r\n## DECLARE\r\n\r\nThis project is intended for educational purposes (graphics, sound, AI training, etc.) or just for fun.\r\n\r\n**ATTENTION PLEASE:**\r\n\r\n**NEVER** use this project for illegal or criminal activities.\r\n\r\nThe author and this project are not responsible for any related consequences resulting from the above usage, and you should use it at your own discretion.\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Protocols of Minecraft version 1.21.4 Encode/Decode in Python.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/me2sy/MYMCP",
        "Issues": "https://github.com/me2sy/MYMCP/issues"
    },
    "split_keywords": [
        "minecraft",
        " protocols",
        " game"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "55cff6f2e29edc2896a31ef120082b5d5131439c1c3edb7c2a2c6a1ed53eeb90",
                "md5": "ec02d1158d1dbbf9b4c8510d5ddfbab4",
                "sha256": "cbbe310647b8be695dae1368971fb550563d61810764ad50bc894d1b1076bee0"
            },
            "downloads": -1,
            "filename": "mymcp-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ec02d1158d1dbbf9b4c8510d5ddfbab4",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.12",
            "size": 298251,
            "upload_time": "2025-02-09T15:42:05",
            "upload_time_iso_8601": "2025-02-09T15:42:05.830431Z",
            "url": "https://files.pythonhosted.org/packages/55/cf/f6f2e29edc2896a31ef120082b5d5131439c1c3edb7c2a2c6a1ed53eeb90/mymcp-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "8e0bda0e97bd31cbe81a3fc5e98be86a275c6f94bd94e5e086253fe2a3e2a7e1",
                "md5": "29cf86ebe96c607ded7a04508341f26d",
                "sha256": "01800214f32e3ddbd23bb33b32e8429c711cfdb2358291ee8f29b6a03d518937"
            },
            "downloads": -1,
            "filename": "mymcp-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "29cf86ebe96c607ded7a04508341f26d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.12",
            "size": 259831,
            "upload_time": "2025-02-09T15:42:07",
            "upload_time_iso_8601": "2025-02-09T15:42:07.120182Z",
            "url": "https://files.pythonhosted.org/packages/8e/0b/da0e97bd31cbe81a3fc5e98be86a275c6f94bd94e5e086253fe2a3e2a7e1/mymcp-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-02-09 15:42:07",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "me2sy",
    "github_project": "MYMCP",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mymcp"
}
        
Elapsed time: 0.38917s