Skip to content
This repository was archived by the owner on Aug 16, 2026. It is now read-only.

Latest commit

 

History

23 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MCPDB

一个我的世界中国版基岩版 Python 调试器后端,简单实现了 DAP 协议。

由于中国版未导出 Python API,本项目通过内存技术实现对游戏内嵌 Python 2.7 解释器的访问和控制。

┌─────────────────────────────────────┐
│           VS Code / IDE             │
│        (DAP Client - debugpy)       │
└──────────────────┬──────────────────┘
                   │ TCP (DAP/JSON)
                   ▼
┌─────────────────────────────────────┐
│        MCPDB (mcpdb.dll)            │
│   DAP Core / Python Wrapper / Hook  │
└──────────────────┬──────────────────┘
                   │ Hook
                   ▼
┌─────────────────────────────────────┐
│  Minecraft China Bedrock (Py 2.7)   │
└─────────────────────────────────────┘

Build

需要 Windows x64, MSVC 2022+, xmake, C++20。

xmake

产物:mcpdb.dllmcdbg.exe

Usage

如果使用其他前端启动器(如 mcdk),请参考对方的配置文档而不是此处的启动说明。

  1. 启动 Modpc
  2. 运行 mcdbg.exe
  3. VS Code 配置 launch.json
{
  "configurations": [
    {
      "name": "Minecraft Modpc Debug",
      "type": "debugpy",
      "request": "attach",
      "connect": {
        "host": "localhost",
        "port": 5678 //由 mcdbg 控制, -p 参数可修改端口
      },
      "pathMappings": [
        {
          "localRoot": "${workspaceFolder}",
          "remoteRoot": "${workspaceFolder}"
        }
      ],
      "justMyCode": false
    }
  ]
}
  1. 设置断点,F5 附加调试

Dependencies

nlohmann_json, fmt, detours, expected-lite

Notice

  • 仅供学习研究
  • 特征码可能随游戏更新失效

License

MIT License

本项目 src/py/ 目录下的 Python 头文件来自 Python 2.7,采用 PSF License

About

一个我的世界中国版基岩版 Python 调试器后端,简单实现了 DAP 协议。

Resources

Stars

26 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages