About this Bot
Minecraft Lite Bot
An ultra-lightweight, high-performance Minecraft protocol bot engineered with minimal resource consumption in mind. Built directly on top of the native Node.js network stack and minecraft-protocol, this bot maintains a persistent presence on Minecraft servers using less than 25MB of RAM, compared to 150MB to 300MB+ consumed by traditional full-physics bots.
---
Overview
Most Minecraft bots (such as standard Mineflayer instances) simulate full client-side physics, parse voxel chunk terrain, process entity physics ticks, and calculate pathfinding graphs. While necessary for autonomous navigation, this overhead consumes substantial CPU cycles and RAM.
Minecraft Lite Bot operates directly at the Minecraft protocol packet layer. It responds immediately to server keepalives, emits lightweight periodic anti-idle interaction packets, and reports connection telemetry without allocating memory for block matrices, lighting updates, or 3D physics collision boxes.
The result is a reliable, always-on utility bot capable of running on virtually any free-tier VPS, shared container, or local background process without degrading host performance.
---
Key Features
- Low Memory Footprint: Typically consumes 18MB to 24MB RSS (< 25MB RAM vs 200MB+ for full bots).
- Zero Heavy Physics Overhead: Completely eliminates chunk parsing, block geometry caching, entity physics calculations, and pathfinding overhead.
- Instant Login and Handshake: Establishes packet handshakes in milliseconds with support for automatic version negotiation across Minecraft 1.8 through 1.20+.
- Native HTTP Health and Status Server: Embedded zero-dependency HTTP server built with native Node.js APIs (no Express or heavyweight web frameworks required). Exposes an HTML dashboard, JSON health check, and metrics endpoints.
- Anti-AFK Packet Keepalive: Emits non-intrusive arm animation swing packets at configurable intervals to prevent server idle timeouts and anti-AFK plugin kicks.
- Resilient Auto-Reconnect: Built-in exponential backoff reconnection system automatically handles server restarts, network blips, and kicks.
- Dual Authentication Support: Works seamlessly on offline-mode (cracked/LAN) servers and official online-mode servers via Microsoft authentication.
- In-Game Chat Commands: Interactive commands (
!pingand!stats) allow players and administrators to query bot latency, memory usage, and uptime in real time.
Performance Comparison
| Metric | Traditional Bot (Mineflayer) | Minecraft Lite Bot |
| --- | --- | --- |
| Memory Usage (RSS) | 150MB - 300MB+ | 18MB - 24MB (< 25MB) |
| World Chunk Loading | Yes (caches blocks/light) | None (packets ignored) |
| Entity Physics Engine | Full client simulation | None (pure protocol) |
| Web Server Dependencies | Express, Webpack, etc. | Native Node.js http |
| Startup Time | 3 to 8 seconds | Sub-second (< 500ms) |
| Free-Tier VPS Capacity | 1 to 2 bots per 512MB RAM | 15 to 20+ bots per 512MB RAM |
---
Architecture and File Structure
minecraft-lite-bot/
assets/
icon.svg # Vector pixel-art project icon
src/
client.js # Protocol client, keepalive handler, and command parser
config.js # Environment variable loader and type-safe sanitizer
index.js # Process bootstrapper and native HTTP server
env.example.txt # Template environment variable configuration
LICENSE.txt # MIT License terms
package.json # Node.js project manifest and dependency tree
README.md # Project documentation
---
Installation and Setup
Prerequisites
- Node.js version 18.0.0 or higher
- npm (Node Package Manager)
Local Setup
1. Clone or extract the repository:
cd minecraft-lite-bot
2. Install production dependencies:
npm install --production
3. Create your environment configuration:
cp env.example.txt .envOn Windows PowerShell:
Copy-Item env.example.txt .env
4. Edit .env with your server address and credentials:
MC_HOST=mc.example.com
MC_PORT=25565
MC_USERNAME=Lite_Bot
MC_AUTH=offline
PORT=3000
5. Launch the bot:
node src/index.js
---
Cloud Hosting Deployment
Minecraft Lite Bot is designed to deploy on modern cloud hosting panels and container platforms (such as Render, Railway, Fly.io, Heroku, Pterodactyl, and custom VPS environments).
Panel Configuration Settings
- Build Command:
npm install --production - Start Command:
node src/index.js - Environment Variables: Set using your hosting platform's web dashboard or settings panel.
Health Check Configuration
Many cloud hosts require a health endpoint to verify that a background container remains responsive. Point your platform's health probe to:
- Health Path:
/health - Expected Status Code:
200 OK - Expected Response Format:
application/json
Built-in Native HTTP Server
The bot includes an embedded HTTP server running directly on Node.js core modules. It requires zero external dependencies, maintaining low memory usage while providing comprehensive monitoring.
Available Endpoints
1. Web Dashboard (GET /):
A clean, self-contained HTML dashboard displaying connection state, target host, current uptime, memory footprint, and recent activity logs. The page automatically polls /api/status for live updates.
2. Health Probe (GET /health):
Returns a compact JSON payload indicating operational readiness.
{
"status": "ok",
"connected": true,
"state": "connected",
"uptime": 3600,
"memoryMB": 21.4,
"timestamp": "2026-11-16T19:50:00.000Z"
}
3. Status Telemetry (GET /api/status):
Returns comprehensive bot metrics including connection state, host configuration, active ping, anti-AFK swing counts, memory breakdowns (RSS, heap total, heap used), and the last 100 log entries.
---
Environment Variables
All settings are configured using environment variables or a local .env file.
| Variable | Type | Default | Description |
| --- | --- | --- | --- |
| MC_HOST | String | localhost | Minecraft server IP address or hostname. |
| MC_PORT | Integer | 25565 | Minecraft server port. |
| MC_USERNAME | String | Lite_Bot | In-game player name or Microsoft account email. |
| MC_VERSION | String | (empty) | Minecraft version (e.g., 1.20.4). Leave blank for auto-negotiation. |
| MC_AUTH | String | offline | Authentication method: offline (cracked/LAN) or microsoft. |
| MC_PASSWORD | String | (empty) | Password (optional for offline mode; required if using Microsoft auth without interactive device code). |
| PORT | Integer | 3000 | HTTP port for the web dashboard and health check probe. |
| HOST | String | 0.0.0.0 | Bind address for the HTTP server. |
| WEB_ENABLED | Boolean | true | Set to false to disable the built-in HTTP server completely. |
| ANTI_AFK_ENABLED | Boolean | true | Enables periodic arm animation packets to avoid idle kicks. |
| ANTI_AFK_INTERVAL_MS | Integer | 25000 | Frequency of arm swing packets in milliseconds. |
| AUTO_RECONNECT | Boolean | true | Automatically reconnects when disconnected or kicked. |
| RECONNECT_MIN_DELAY_MS | Integer | 5000 | Minimum reconnection backoff delay in milliseconds. |
| RECONNECT_MAX_DELAY_MS | Integer | 60000 | Maximum reconnection backoff delay in milliseconds. |
| CHAT_PREFIX | String | ! | Prefix character for recognizing in-game commands. |
---
In-Game Chat Commands
When enabled, players on the server can send commands in public chat or via direct messages to inspect bot status.
| Command | Arguments | Description | Example Output |
| --- | --- | --- | --- |
| !ping | None | Returns bot ping and current session uptime. | [LiteBot] Pong! Ping: ~42ms \| Uptime: 1420s |
| !stats | None | Reports detailed RAM consumption, ping, anti-AFK swing counts, and uptime. | [LiteBot] RAM: 21.8MB RSS (12.4MB Heap) \| Ping: 42ms \| Swings: 58 \| Uptime: 1420s |
---
Server Compatibility
Minecraft Lite Bot works across standard Java Edition server implementations:
- Vanilla Minecraft Server (1.8 through 1.20+)
- Paper, Spigot, Purpur, and Bukkit
- Fabric and Forge (with standard vanilla network handshake)
- BungeeCord, Waterfall, and Velocity proxies
- Free and Budget Hosting Providers (Aternos, Minehut, FalixNodes, PebbleHost, ScalaCube)
Offline Mode and Online Mode
- Offline Mode: By default,
MC_AUTH=offlineallows connection to cracked servers, LAN worlds, or local development environments without authentication credentials. - Online Mode: Set
MC_AUTH=microsoftto authenticate with official Mojang/Microsoft accounts. The client securely handles OAuth token exchanges.
Troubleshooting FAQ
The bot connects but gets kicked immediately with "Invalid session" or "Verify your account".
The target server is running in online mode (online-mode=true), but the bot is set to MC_AUTH=offline. To connect to official servers, configure MC_AUTH=microsoft with valid Microsoft credentials.
How do I run the bot without the web server?
SetWEB_ENABLED=false in your .env file or container environment variables. The bot will run in pure CLI mode, further reducing memory usage down to roughly 16MB RSS.
Does the bot move around or dig blocks?
No. The Lite Bot is designed specifically for lightweight server presence, AFK chunk loading, uptime monitoring, and latency testing. By omitting chunk decoding and physics processing, it maintains a memory footprint below 25MB RAM. If you require full physical movement, inventory pathfinding, or block placement, consider a full-featured physics bot such as Minecraft AFK Bot.The server uses a custom port. How do I configure it?
Specify the port in theMC_PORT variable (for example, MC_PORT=25577 or MC_PORT=19132). If your server uses SRV records, provide the hostname in MC_HOST and minecraft-protocol will resolve the target port automatically.
Why does memory usage report around 20MB when standard bots take 200MB?
Standard bots store world block voxels, light maps, entities, and pathfinding navmeshes in heap memory. Because Minecraft Lite Bot discards terrain chunk packets and does not calculate collision geometry, it avoids allocating large arrays, keeping heap and RSS memory usage minimal.---
License
This project is licensed under the terms of the MIT License. See LICENSE.txt for details.
Package Versions (2)
Changelog
No changelog provided.
No changelog provided.