# lurete-cn/ntvector architecture

> Architecture diagram of the GitHub repository lurete-cn/ntvector, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-05). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/lurete-cn/ntvector
- Repository: https://github.com/lurete-cn/ntvector

## Overview

NTvector is a Minecraft Bedrock bot client with an embedded Python plugin runtime. Its main workflow is to load startup/account configuration, establish an authenticated game connection through a selected transport, exchange Bedrock packets, and expose client events and state to Python plugins. Other documented capabilities include NetherNet, WebSocket/WebRTC transports, skin conversion, MCP filesystem mode, cryptography, and plugin hot-reload. The tree and excerpts support the application entry, connection setup, and Python startup; several feature branches are documented in the README but their internal wiring was not sampled.

Main entry points: [`application/Core/ClientInstance.h`](https://github.com/lurete-cn/ntvector/blob/main/application/Core/ClientInstance.h) (Client instance), [`application/application.cpp`](https://github.com/lurete-cn/ntvector/blob/main/application/application.cpp) (Application entry), [`application/Python/engine.cpp`](https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine.cpp) (Engine module), [`application/Core/LoginAuth.cpp`](https://github.com/lurete-cn/ntvector/blob/main/application/Core/LoginAuth.cpp) (Login and auth)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Startup and Identity"]
  node_main["Application entry<br/>[application.cpp]"]
  node_config["Startup configuration<br/>[ConfigLoader.cpp]"]
  node_auth["Login and auth<br/>[LoginAuth.cpp]"]
  node_session["Login session<br/>[LoginSession.cpp]"]
  node_crypto["Crypto and encoding<br/>[EasyUtils.cpp]"]
end

subgraph group_connect["Connection and Protocol"]
  node_bedrock["Bedrock packets<br/>[PacketBase.cpp]"]
  node_raknet["RakNet transport<br/>[RakNetClient.cpp]"]
  node_nethernet["NetherNet transport"]
  node_websocket["WebSocket transport"]
  node_webrtc["WebRTC transport"]
end

subgraph group_client["Client Runtime"]
  node_client["Client instance<br/>[ClientInstance.h]"]
  node_callbacks["Packet callbacks<br/>[CallbackManger.cpp]"]
  node_player["Local player state<br/>[LocalPlayer.cpp]"]
  node_skin["Skin conversion<br/>[SkinConverter.cpp]"]
  node_mcp["MCP filesystem<br/>[MCPFileSystem.cpp]"]
end

subgraph group_plugins["Python and Features"]
  node_python["Embedded Python<br/>[PythonRuntime.cpp]"]
  node_engine["Engine module<br/>[engine.cpp]"]
  node_wrapper["Python client bindings<br/>[engine_wrapper.h]"]
  node_plugin_events["Plugin events<br/>[engine.cpp]"]
end

node_operator(("Operator"))
node_server(("Bedrock server"))

node_operator -->|"starts"| node_main
node_main -.->|"loads config"| node_config
node_main -->|"creates"| node_client
node_main -->|"starts runtime"| node_python
node_client -->|"uses session"| node_session
node_client -->|"connects via"| node_raknet
node_client -->|"connects via"| node_nethernet
node_client -.->|"may use"| node_websocket
node_client -.->|"may use"| node_webrtc
node_raknet -.->|"exchanges packets"| node_server
node_nethernet -.->|"connects"| node_server
node_websocket -.->|"transports data"| node_server
node_webrtc -.->|"transports data"| node_server
node_client -.->|"sends packets"| node_bedrock
node_bedrock -.->|"dispatches"| node_callbacks
node_callbacks -.->|"updates state"| node_player
node_python -.->|"registers modules"| node_engine
node_engine -.->|"exposes client data"| node_wrapper
node_engine -->|"triggers events"| node_plugin_events
node_plugin_events -.->|"notifies plugins"| node_operator
node_auth -.->|"creates session"| node_session
node_crypto -.->|"supports crypto"| node_auth
node_skin -.->|"provides skin data"| node_client
node_mcp -.->|"supports MCP mode"| node_client

click node_main "https://github.com/lurete-cn/ntvector/blob/main/application/application.cpp"
click node_config "https://github.com/lurete-cn/ntvector/blob/main/application/Core/ConfigLoader.cpp"
click node_auth "https://github.com/lurete-cn/ntvector/blob/main/application/Core/LoginAuth.cpp"
click node_session "https://github.com/lurete-cn/ntvector/blob/main/application/Core/LoginSession.cpp"
click node_client "https://github.com/lurete-cn/ntvector/blob/main/application/Core/ClientInstance.h"
click node_bedrock "https://github.com/lurete-cn/ntvector/blob/main/application/Packets/PacketBase.cpp"
click node_callbacks "https://github.com/lurete-cn/ntvector/blob/main/application/Core/CallbackManger.cpp"
click node_player "https://github.com/lurete-cn/ntvector/blob/main/application/Core/LocalPlayer.cpp"
click node_raknet "https://github.com/lurete-cn/ntvector/blob/main/application/Network/RakNetClient.cpp"
click node_nethernet "https://github.com/lurete-cn/ntvector/blob/main/application/Network/NetherNetConnectInstance.cpp"
click node_websocket "https://github.com/lurete-cn/ntvector/blob/main/application/Network/WebSocketClient.cpp"
click node_webrtc "https://github.com/lurete-cn/ntvector/blob/main/application/Network/web_rtc_python_wrapper.cpp"
click node_python "https://github.com/lurete-cn/ntvector/blob/main/application/Python/PythonRuntime.cpp"
click node_engine "https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine.cpp"
click node_wrapper "https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine_wrapper.h"
click node_plugin_events "https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine.cpp"
click node_crypto "https://github.com/lurete-cn/ntvector/blob/main/application/Crypto/EasyUtils.cpp"
click node_skin "https://github.com/lurete-cn/ntvector/blob/main/application/Core/SkinConverter.cpp"
click node_mcp "https://github.com/lurete-cn/ntvector/blob/main/application/Core/MCPFileSystem.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_config,node_auth,node_session,node_crypto toneBlue
class node_bedrock,node_raknet,node_nethernet,node_websocket,node_webrtc toneAmber
class node_client,node_callbacks,node_player,node_skin,node_mcp,node_server toneMint
class node_python,node_engine,node_wrapper,node_plugin_events toneRose
class node_operator toneIndigo
```

## Components

### Startup and Identity

- [Application entry](https://github.com/lurete-cn/ntvector/blob/main/application/application.cpp): `application/application.cpp`
- [Startup configuration](https://github.com/lurete-cn/ntvector/blob/main/application/Core/ConfigLoader.cpp): `application/Core/ConfigLoader.cpp`
- [Login and auth](https://github.com/lurete-cn/ntvector/blob/main/application/Core/LoginAuth.cpp): `application/Core/LoginAuth.cpp`
- [Login session](https://github.com/lurete-cn/ntvector/blob/main/application/Core/LoginSession.cpp): `application/Core/LoginSession.cpp`
- [Crypto and encoding](https://github.com/lurete-cn/ntvector/blob/main/application/Crypto/EasyUtils.cpp): `application/Crypto/EasyUtils.cpp`

### Connection and Protocol

- [Bedrock packets](https://github.com/lurete-cn/ntvector/blob/main/application/Packets/PacketBase.cpp): `application/Packets/PacketBase.cpp`
- [RakNet transport](https://github.com/lurete-cn/ntvector/blob/main/application/Network/RakNetClient.cpp): `application/Network/RakNetClient.cpp`
- [NetherNet transport](https://github.com/lurete-cn/ntvector/blob/main/application/Network/NetherNetConnectInstance.cpp): `application/Network/NetherNetConnectInstance.cpp`
- [WebSocket transport](https://github.com/lurete-cn/ntvector/blob/main/application/Network/WebSocketClient.cpp): `application/Network/WebSocketClient.cpp`
- [WebRTC transport](https://github.com/lurete-cn/ntvector/blob/main/application/Network/web_rtc_python_wrapper.cpp): `application/Network/web_rtc_python_wrapper.cpp`

### Client Runtime

- [Client instance](https://github.com/lurete-cn/ntvector/blob/main/application/Core/ClientInstance.h): `application/Core/ClientInstance.h`
- [Packet callbacks](https://github.com/lurete-cn/ntvector/blob/main/application/Core/CallbackManger.cpp): `application/Core/CallbackManger.cpp`
- [Local player state](https://github.com/lurete-cn/ntvector/blob/main/application/Core/LocalPlayer.cpp): `application/Core/LocalPlayer.cpp`
- [Skin conversion](https://github.com/lurete-cn/ntvector/blob/main/application/Core/SkinConverter.cpp): `application/Core/SkinConverter.cpp`
- [MCP filesystem](https://github.com/lurete-cn/ntvector/blob/main/application/Core/MCPFileSystem.cpp): `application/Core/MCPFileSystem.cpp`

### Python and Features

- [Embedded Python](https://github.com/lurete-cn/ntvector/blob/main/application/Python/PythonRuntime.cpp): `application/Python/PythonRuntime.cpp`
- [Engine module](https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine.cpp): `application/Python/engine.cpp`
- [Python client bindings](https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine_wrapper.h): `application/Python/engine_wrapper.h`
- [Plugin events](https://github.com/lurete-cn/ntvector/blob/main/application/Python/engine.cpp): `application/Python/engine.cpp`

### Other components

- **Operator**
- **Bedrock server**

## Connections

- Operator → Application entry: starts (evidence: `README.md`)
- Application entry → Startup configuration: loads config
- Application entry → Client instance: creates (evidence: `application/application.cpp`)
- Application entry → Embedded Python: starts runtime (evidence: `application/application.cpp`)
- Client instance → Login session: uses session (evidence: `application/Core/ClientInstance.h`)
- Client instance → RakNet transport: connects via (evidence: `application/Core/ClientInstance.h`)
- Client instance → NetherNet transport: connects via (evidence: `application/Core/ClientInstance.h`)
- Client instance → WebSocket transport: may use
- Client instance → WebRTC transport: may use
- RakNet transport → Bedrock server: exchanges packets
- NetherNet transport → Bedrock server: connects
- WebSocket transport → Bedrock server: transports data
- WebRTC transport → Bedrock server: transports data
- Client instance → Bedrock packets: sends packets
- Bedrock packets → Packet callbacks: dispatches
- Packet callbacks → Local player state: updates state
- Embedded Python → Engine module: registers modules
- Engine module → Python client bindings: exposes client data
- Engine module → Plugin events: triggers events (evidence: `application/Python/engine.cpp`)
- Plugin events → Operator: notifies plugins
- Login and auth → Login session: creates session
- Crypto and encoding → Login and auth: supports crypto
- Skin conversion → Client instance: provides skin data
- MCP filesystem → Client instance: supports MCP mode
