This is a lightweight Minecraft Java AFK Bot powered by Mineflayer. It connects to a Java server, performs basic movements to avoid AFK detection, and can be customized via a simple configuration file.
-
Before starting the bot, please make sure that the Offline Mode (Pirated/Not Original) option in the settings section of your Aternos server is active.
-
Secure the bot to protect it from monsters in the game.
- Connect to Minecraft Java servers (IP + port)
- Customize bot username
- Control chunk loading and memory usage
- Periodic chunk pruning to reduce resource usage
- Auto-movement behavior: step forward/backward, jump, sneak, loop
- Easy configuration via
config.json
git clone https://github.com/icelaterdc/Minecraft-AFK-Bot.git
cd Minecraft-AFK-Bot
npm install
{
"serverHost": "yourserver.aternos.me",
"serverPort": 25565,
"botUsername": "MyBotName",
"botChunk": 4
}
⚠️ Make sure the server is in offline mode if you're not using premium accounts.
node bot.js
On successful connection:
- You'll see
✅ BotName is Ready!
in the console - After 5 seconds, all loaded chunks are cleared
- Every 20 seconds, any chunks beyond a 6-chunk radius will be removed
Key | Description |
---|---|
serverHost |
IP or domain of your Minecraft server |
serverPort |
Server port (default is 25565) |
botUsername |
The bot's visible name in-game |
botChunk |
Radius of loaded chunks (recommended: 1–6) |
- Skins: Skins might not appear properly if the server is in offline mode.
- Sneak Movement: The bot uses
setControlState('sneak', true)
, but some servers may block or ignore this action. - AFK Prevention: The bot periodically moves, sneaks, and jumps to prevent disconnection due to inactivity.
Feel free to contribute by opening a pull request or submitting an issue.
This project is licensed under the MIT License.
Get started now and keep your server active with a smart, customizable bot! ⛏️