A simple TypeScript-based Minecraft bot that connects to a Minecraft Java server and stays online to keep the server active.
Primarily useful for free hosting platforms like Aternos, Minehut, or any self-hosted Minecraft server.
This bot only connects to a running server.
It does NOT automate starting or controlling any hosting panel.
- Connects as a real Minecraft player
- Keeps server active by staying online
- Written in TypeScript
- Works with Aternos and other Java servers
- Easy to configure and extend
- Node.js v18 or higher
- npm
- Minecraft Java account (for online-mode servers)
- A running Minecraft Java server
Clone the repository:
git clone https://github.com/sh3xu/minecraft-bot.git
cd minecraft-botInstall dependencies:
npm installCreate a .env file in the project root:
SERVER_HOST=your.server.address
SERVER_PORT=25565
BOT_USERNAME=YourBotUsername
BOT_PASSWORD=YourBotPasswordSERVER_HOST=example123.aternos.me
SERVER_PORT=25565
BOT_USERNAME=AFKBotNotes:
- If your server runs on the default port
25565, keep it as shown. - For offline-mode servers, password may not be required.
- For online-mode servers, use a valid Minecraft account.
Compile TypeScript:
npm run buildStart the bot:
npm startOr run directly:
node dist/bot.jsIf successful, the bot will join the server as a player.
- Start your Aternos server manually from the panel.
- Wait until the server status is online.
- Run this bot locally or on a VPS.
- The bot joins the server and keeps it active.
Important:
- This bot does NOT bypass Aternos limits.
- Automating the Aternos panel is against their ToS.
- This bot only provides in-game presence.
This bot works with:
- Self-hosted servers
- VPS-hosted servers
- Paid Minecraft hosting providers
Steps are the same:
- Start the server
- Set correct host and port
- Run the bot
Bot does not connect
- Server is offline
- Wrong host or port
- Firewall blocking connection
Authentication error
- Wrong username/password
- Server auth mode mismatch
Version issues
- Minecraft server version not supported by bot library
- Update dependencies if needed
For development or extending bot behavior:
npm run devYou can add:
- Chat listeners
- AFK movement logic
- Command handling
- Plugins like pathfinding
Use this bot responsibly. Always follow:
- Minecraft EULA
- Server rules
- Hosting provider Terms of Service
MIT License
Just say the word 👌