Testing with bots
The mineflayer bot suite that plays MineDuels like normal players, what it covers, and how to read a run.
The repository folder mineduels-bots holds a suite of scripted bots (mineflayer). They join through the proxy, queue, fight, open menus, form parties and move between servers like players, and write down everything they see.
Running it
cd mineduels-bots
node run.js --list
node run.js --only network-join,cross-queue,disconnect-rejoin
node run.js| Option | Meaning |
|---|---|
--host, --port | Where to connect. The default is the proxy on 127.0.0.1:19136. |
--bots | The most bots to use (a few slots are kept free for real players). |
--logs lobby=...,game=...,proxy=... | The latest.log of each server. Without it the sibling server folders are searched. |
--lobby-server, --game-server | The names under [servers] in velocity.toml (default lobby and practice). |
--allow-players | Run even when real players are online. |
--no-human | Switch off the small idle looking around. |
The run refuses to start while a real player is online. Bots are named QAbot_01 to QAbot_30, use unranked queues only and leave real ratings alone.
What it covers
| Scenario | Checks |
|---|---|
network-join | Bots land on a lobby through the proxy, see each other in the tab list and an online count. |
cross-queue | A queue match moves both bots to the duel server. They wait without lobby items, see the arrival box, land a hit after the countdown (the delay is recorded), and return to a lobby. |
party-games | Split, free for all, team battle and red rover run on the duel server, not on the lobby. |
tournament | Bouts run on the duel server and the bracket advances. |
disconnect-rejoin | A bot that disconnects after a match was found: reconnecting goes straight to the duel server, staying away cancels the match and queues the other bot again; a party member who disconnects leaves the party. |
cages | The block displays of gate and elevator starts begin moving within about two ticks of each other. |
windcharge | A wind charge thrown in the lobby does not push another player. |
match-commands | An unlisted command is refused during a duel; a listed one works. |
regions | The /regions menu opens and a click switches a region. |
| Others | Lobby join, settings, kit editor, party, social, spectating, stats, firework, edge cases, a soak run and a stress ramp. |
A scenario that needs something the server does not have, such as a permission, a region or the proxy log, is skipped with the reason.
Permissions
Bots cannot give themselves permissions. node tools/grant-perms.js prints the LuckPerms commands for a QA group (spear, fly, elytra, tournament host, spectate) and --revoke prints the commands that undo them. Do not give the QA group mineduels.match.commands.bypass when you want to see the command refusal.
Reading a run
Each run writes reports/<time>/:
report.mdandreport.json: every scenario with its checks, metrics and notes.timeline.log: bot events, check results and server log lines in one list, by time.bots/<name>.log: everything one bot saw and did, including chat, titles, windows with their items, tab and sidebar text, effects, position every second, commands, server switches and kicks.servers/lobby.log,game.log,proxy.log: the log lines of each server during each scenario.
A scenario also fails on a MineDuels error in any server log. A bot that did not behave like a player, for example the proxy could not read one of its packets or the server said it moved too quickly, is listed as a warning with a count.
Limits
Bots read packets, items, entities, timings and logs. They cannot judge how smooth an animation looks. The cages scenario measures when display entities start moving, not how they look.
Cleaning up
Bots create player rows under their own offline UUIDs. node src/cleanup.js shows what would be removed and node src/cleanup.js --apply removes only the bot rows after backing up the database. Run it with the bots offline.