๐ ๏ธ A load testing tool for Minecraft servers based on Mineflayer and YAML scenarios.
โ
Simulates Minecraft bots (joining, movement, chat, interactions...)
โ
Easy configuration using YAML scenarios
โ
Multi-threading support (configurable number of threads for better performance)
โ
Supports SOCKS5 proxies (optional activation)
โ
Advanced logging system (logs/bot.log)
โ
Automatic reconnection (to be implemented if needed)
โ
Ability to load custom scenarios
git clone https://github.com/GaetanOff/StressTest-MC.git
cd Stress-Test-MCIf you're using pnpm:
pnpm installOtherwise, with npm:
npm installThe config/config.json file allows you to adjust project settings.
botJoinDelay(number): Delay in milliseconds between bot connections (default: 500ms)threads(number): Number of worker threads to use for bot management (default: 1)- Use
1for single-threaded execution (original behavior) - Use
> 1to enable multi-threading and improve performance with many bots
- Use
proxy: Proxy configuration for SOCKS5 proxieslogging: Logging configuration (enable/disable and log level)
{
"botJoinDelay": 500,
"threads": 3,
"proxy": {
"enabled": false,
"list": [
{ "host": "proxy1.com", "port": 1080 },
{ "host": "proxy2.com", "port": 1080 }
],
"maxRetries": 3
},
"logging": {
"enabled": true,
"level": "info"
}
}๐ Note: The server configuration (host, port, version) is defined in each scenario YAML file, not in config.json.
Scenarios are defined in config/scenarios/ using YAML.
name: "Stress Test - Exploration and Chat"
numberOfBots: 60 # Total number of bots to spawn
server:
host: "play.example.com"
port: 25565
event:
onJoin:
execute: "/help" # Command executed as soon as the bot joins
wait: 2s # Wait 2 seconds before executing the next actions
actions:
move-group:
type: move
position:
x: 100
y: 65
z: 200
speed: normal # slow, normal, fast
waitAfter: 5s # Waiting time after reaching the destination
send-messages:
type: chat
messages:
- "Hello everyone!"
- "Anyone up for a game?"
- "I'm a bot, but a friendly one ๐ค"
interval: 10s # Time between each message
interact-block:
type: interact
target:
x: 105
y: 65
z: 205
action: "right_click" # Can be "left_click" or "right_click"
delay: 3s # Time before interactionnode src/index.js scenario-1.yml๐ If no scenario is specified, scenario-1.yml will be used by default.
To improve performance when launching many bots, you can configure multiple threads in config.json:
{
"threads": 4 // Launch bots across 4 threads
}The bots will be automatically distributed across the specified number of threads. Each bot will be named Bot-ThreadNumber-LocalNumber (e.g., Bot-1-1, Bot-1-2, Bot-2-1, etc.).
In config.json, set "enabled": true under "proxy":
"proxy": {
"enabled": true,
"list": [
{ "host": "proxy1.com", "port": 1080 },
{ "host": "proxy2.com", "port": 1080 }
],
"maxRetries": 3
}This project includes a Docker setup to easily run Minecraft bot stress tests without installing dependencies manually.
docker build -t stress-test-mc .To start the project inside a Docker container:
docker run --rm -it stress-test-mcThis will launch the bots as defined in the default scenario.
To run a specific scenario:
docker run --rm -it stress-test-mc node src/index.js scenario-2.ymlIf you want to modify files without rebuilding the image, mount the current directory:
docker run --rm -it -v $(pwd):/app stress-test-mcThis allows you to edit code locally, and it will reflect inside the container.
mc-load-tester/
โโโ config/
โ โโโ scenarios/ # ๐ YAML scenarios
โ โ โโโ scenario-1.yml
โ โ โโโ scenario-2.yml
โ โโโ config.json # โ๏ธ Main configuration
โ
โโโ src/
โ โโโ bots/
โ โ โโโ botManager.js # ๐ฎ Bot management & multi-threading
โ โ โโโ botFactory.js # ๐๏ธ Bot creation
โ โ โโโ botActions.js # ๐ง Bot actions
โ โ โโโ botLifecycle.js # ๐ Shared bot lifecycle functions
โ โ โโโ worker.js # ๐งต Worker thread handler
โ โโโ scenario/
โ โ โโโ scenarioManager.js # ๐ Scenario execution
โ โ โโโ scenarioParser.js # ๐ YAML parsing
โ โโโ utils/
โ โ โโโ logger.js # ๐๏ธ Logging system
โ โ โโโ helpers.js # โก Utility functions
โ
โโโ logs/ # ๐ Log files (auto-created)
โโโ index.js # ๐ Main entry point
โโโ package.json # ๐ฆ Dependencies and scripts
โโโ README.md # ๐ Documentation
Logs are recorded in logs/bot.log.
Example (single-threaded):
[2025-01-30T07:57:39.999Z] [INFO] ๐ Launching 60 bots...
[2025-01-30T07:57:40.000Z] [INFO] ๐ค Creating bot: Bot_1
[2025-01-30T07:57:40.001Z] [INFO] โ
Bot_1 has connected!
[2025-01-30T07:57:42.005Z] [INFO] ๐ฌ Bot_1 says: "Hello everyone!"
Example (multi-threaded):
[2025-01-30T07:57:39.999Z] [INFO] ๐ Launching 60 bots...
[2025-01-30T07:57:39.999Z] [INFO] ๐งต Starting 60 bots across 3 threads (โ20 bots per thread)
[2025-01-30T07:57:40.000Z] [INFO] [Thread 1] ๐ค Creating bot: Bot-1-1
[2025-01-30T07:57:40.000Z] [INFO] [Thread 2] ๐ค Creating bot: Bot-2-1
[2025-01-30T07:57:40.000Z] [INFO] [Thread 3] ๐ค Creating bot: Bot-3-1
[2025-01-30T07:57:40.001Z] [INFO] [Thread 1] โ
Bot-1-1 has connected!
All the code is licensed under GPL v3.
Feel free to modify and improve it! ๐
๐ก Ideas, suggestions, or bugs?
Open an issue or submit a pull request!
๐ง contact@gaetandev.fr
๐ Website
๐ฌ Discord: GaetanDev
If you have any questions or suggestions, let me know! ๐๐