A Minecraft AFK bot built with Botcraft.
- CMake 3.19 or higher
- C++17 compatible compiler (GCC, Clang, or MSVC)
- Git (for submodule management)
- OpenSSL development libraries
- Linux:
libssl-dev - macOS:
openssl(via Homebrew) - Windows: Included with Visual Studio
- Linux:
Run the setup wizard to configure the bot:
./bin/mc-afker --setupThe setup wizard will ask for:
- Server address (e.g.,
mc.example.com:25565) - Username (for offline mode)
- Password (for
/registerand/logincommands) - Warp locations and wait times
Configuration is saved to config.json. After setup, you can simply run:
./bin/mc-afkerThe bot uses config.json for configuration. Example:
{
"server": {
"address": "mc.example.com:25565",
"username": "YourBot",
"password": "your_password"
},
"warps": [
{
"name": "creeper_farm",
"wait_minutes": 30
},
{
"name": "slime_farm",
"wait_minutes": 30
}
]
}You can edit config.json directly or run --setup again to reconfigure.
The easiest way to build the project is using the provided build scripts:
Linux/macOS:
./build.shWindows:
build.batUsing Make (Linux/macOS):
make
# Or with custom build type:
make BUILD_TYPE=Debug-
Initialize submodules:
git submodule update --init --recursive
-
Create build directory:
mkdir build cd build -
Configure CMake:
cmake .. -DCMAKE_BUILD_TYPE=Release
-
Build:
cmake --build . --config Release
The executable will be located at build/bin/mc-afker (or build/bin/mc-afker.exe on Windows).
You can configure Botcraft options through CMake:
cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DBOTCRAFT_COMPRESSION=ON \
-DBOTCRAFT_ENCRYPTION=ON \
-DBOTCRAFT_GAME_VERSION=1.21.10Available Botcraft options:
BOTCRAFT_COMPRESSION: Enable compression (default: ON)BOTCRAFT_ENCRYPTION: Enable encryption/online mode (default: ON)BOTCRAFT_GAME_VERSION: Minecraft version to target (default: latest)BOTCRAFT_USE_OPENGL_GUI: Enable OpenGL GUI (default: OFF)BOTCRAFT_USE_IMGUI: Enable ImGui overlay (default: OFF)
docker-compose up -d
docker-compose exec builder bashThen inside the container:
./build.shdocker build -t mc-afker .
docker run -it -v $(pwd):/workspace mc-afkerThe project includes GitHub Actions workflows for automated builds on:
- Linux (Ubuntu)
- macOS
- Windows
Builds are triggered on push to main/master/develop branches and on pull requests.
mc-afker/
├── CMakeLists.txt # Root CMake configuration
├── Makefile # Make wrapper for CMake
├── build.sh # Unix build script
├── build.bat # Windows build script
├── Dockerfile # Docker build environment
├── docker-compose.yml # Docker Compose configuration
├── src/
│ └── main.cpp # Main application source
└── libs/
└── Botcraft/ # Botcraft library (git submodule)
After setup, simply run:
./bin/mc-afkerThe bot will:
- Connect to the configured server
- Register (first time) or login (subsequent runs)
- Loop through configured warps, waiting the specified time at each
--setup- Run setup wizard to configure the bot--first-time- Force registration (even if already registered)--help- Show help message
# First time: run setup
./bin/mc-afker --setup
# Subsequent runs: just run the bot
./bin/mc-afker
# Force re-registration
./bin/mc-afker --first-timeDebug: Debug build with symbolsRelease: Optimized release buildRelWithDebInfo: Release with debug infoMinSizeRel: Minimum size release
# Using Make
make clean
# Manual
rm -rf buildThis project uses the Botcraft library. See libs/Botcraft/LICENSE for Botcraft's license terms.