Preface¶
When extending agent capabilities in DSH, a common need is to encapsulate external tools, local services, or client operations into callable tools. dsh-mc-agent takes this step for Minecraft: it drives Mineflayer bots via the LAN protocol, supporting autonomous survival, mining and tree-cutting, in-game chat, and real-time maps. It also provides a built-in launcher that handles Microsoft login, version downloads, and Java game process launching.
This plugin is labeled UNOFFICIAL and has no official affiliation with Mojang Studios / Microsoft. It does not include or distribute Mojang game content; game files are downloaded from Mojang’s official endpoints.
What Is This¶
dsh-mc-agent is a DSH plugin maintained by hellosky983, licensed under MIT. It exposes game data and capabilities as mc_* tools for DSH agents to invoke via dialogue. By default, it can be used as a Minecraft tab within the DSH chat interface or switched to a full-screen launcher.
It primarily addresses three aspects:
-
AI Agent: Connects directly to the game via the LAN protocol to drive a real Mineflayer bot, supporting autonomous survival, mining and tree-cutting, in-game chat, and real-time maps.
-
Visual and Control:
mc_screenshotcaptures the game window,mc_seeuses DashScope Qwen-VL for visual understanding, andmc_controlsimulates keyboard and mouse input via xdotool. Together, agents can take next actions based on the on-screen state. -
Built-in Launcher: Uses the official version list to install
client jar,libraries,assets, and starts the Java game process. Microsoft login uses the user’s own registered Azure applicationclient idvia the device code flow.
Core Features¶
Mineflayer Fast Mode¶
The mc_bot_* tools read real-time position, inventory, health, surrounding blocks, and perform precise control via the LAN protocol. This mode directly reads in-game data, suitable for scenarios requiring rapid state updates and precise operations.
Visual and Control Loop¶
mc_screenshot captures the game window, mc_see sends the screenshot to DashScope Qwen-VL for visual understanding, and mc_control simulates keyboard and mouse input using xdotool. Combined, agents can make decisions based on the visual state.
Launcher Capabilities¶
The built-in launcher uses the official version list to install client jar, libraries, and assets, and starts the Java game process. Microsoft login uses the user’s own registered Azure application client id via the device code flow.
Dialogue Tools¶
Beyond the launcher and bot control, the plugin provides the following capabilities:
mc_analyze_crash: AI crash analysismc_world_info/mc_mods/mc_version_advice: Game assistantmc_set_goals/mc_goals/mc_complete_goal: Autonomous survival goal framework
These tools allow agents to query saves, mods, version suggestions, crash reports, and progress goals within dialogue.
Installation and Enablement¶
Environment Requirements: Node.js 18+, DSH 0.1.0-rc.6, Java required for launching games; different MC versions have specific Java version requirements, e.g., 1.21+ requires Java 21+.
Method A: Install into an Existing DSH Profile¶
First, clone the repository:
git clone https://github.com/hellosky983/dsh-mc-agent.git
Then edit the target profile’s package.json. Add dsh-mc-agent to dependencies and include the bundle name in dsh.profile.bundles:
{
"dependencies": {
"dsh-mc-agent": "link:/path/to/dsh-mc-agent"
},
"dsh": {
"profile": {
"bundles": ["dsh-mc-agent"]
}
}
}
If the profile already has other bundles, append to the existing bundles array instead of overwriting.
Navigate to the profile directory, install dependencies, and restart DSH:
cd <profile directory>
pnpm install
Method B: Create a Standalone Profile¶
Suitable for isolation from existing DSH instances.
Clone the repository:
git clone https://github.com/hellosky983/dsh-mc-agent.git
Create <project>/dsh-home/profiles/minecraft/package.json:
{
"name": "dsh-profile-minecraft",
"private": true,
"dependencies": {
"dsh-mc-agent": "link:../../../dsh-mc-agent"
},
"dsh": {
"profile": {
"bundles": [
"@deepseek-ai/dsh-base",
"@deepseek-ai/dsh-web-app",
"dsh-mc-agent"
]
}
}
}
Install and start the standalone instance:
cd <project>/dsh-home/profiles/minecraft
pnpm install
DSH_HOME=<project>/dsh-home dsh --profile minecraft --port 39970
Open in browser:
http://127.0.0.1:39970
Typical Usage¶
Configuring Microsoft Login¶
-
Create an App registration in the Azure portal, allowing public client flows.
-
Copy the Application (client) ID.
-
Enter the Microsoft client id in the launcher settings.
-
Log in using the device code.
It is mandatory to use your own registered Azure application client id; do not use someone else’s registered client id.
Dialogue-Driven Gameplay¶
After completing login and launching, tools can be invoked within DSH dialogue. Common workflows include:
-
Use
mc_set_goalsto set autonomous survival goals, thenmc_goalsto view goals, andmc_complete_goalto progress goals. -
Use
mc_bot_*to read position, inventory, health, surrounding blocks, and perform precise control. -
Use
mc_screenshot,mc_see,mc_controlto form a visual and control loop. -
Use
mc_analyze_crashto analyze crashes; usemc_world_info,mc_mods,mc_version_adviceto query saves, mods, and version suggestions.
Uninstallation¶
Remove the dsh-mc-agent entry from the dependencies and dsh.profile.bundles in the profile’s package.json, then reinstall dependencies and restart DSH:
cd <profile directory>
pnpm install
To clean up plugin local data, you can delete ~/.dsh-mc/; the game directory ~/.minecraft/ remains unaffected and can be retained.
Use Cases and Considerations¶
Suitable for:
- Integrating Minecraft’s launch, runtime status, saves, and crash information into a DSH agent
- Enabling agents to read in-game data and perform mining, movement, placement, and other operations
- Using visual models to understand game screens and perform keyboard/mouse control
Considerations:
-
Unofficial: The plugin is labeled
UNOFFICIALand is not affiliated with Mojang Studios / Microsoft. -
Account Requirements: Offline mode is not provided; gameplay requires login with the user’s own Microsoft account. Microsoft login requires using your own registered Azure application
client id. -
Permissions: The plugin reads and writes
~/.minecraft, writes to~/.dsh-mc, and accesses network endpoints such as Mojang, Microsoft, and DashScope.mc_controlexecutes xdotool to simulate keyboard and mouse, andmc_screenshotcaptures the Minecraft window. -
Runtime Permissions: The plugin runs with the current DSH process permissions. Before installation, check the source code, license, and dependencies.
-
Data: No telemetry or third-party statistics; account tokens are saved in
~/.dsh-mc/account.jsonwith permissions600.
Conclusion¶
The value of dsh-mc-agent lies in bringing together Minecraft launching, Mineflayer bots, visual control, and dialogue tools into a single DSH plugin, enabling agents not only to chat about games but also to read game states and execute operations.
Repository: https://github.com/hellosky983/dsh-mc-agent