All Projects → adepierre → Botcraft

adepierre / Botcraft

Licence: gpl-3.0
Botcraft is a cross-platform C++ library to create bots that connect and interact with Minecraft servers with (optional) integrated OpenGL renderer

Programming Languages

cpp
1120 projects

Projects that are alternatives of or similar to Botcraft

Fishingbot
1.8 - 1.16.5 Fishing bot for Minecraft
Stars: ✭ 119 (+190.24%)
Mutual labels:  bot, minecraft
Mineflayer
Create Minecraft bots with a powerful, stable, and high level JavaScript API.
Stars: ✭ 2,377 (+5697.56%)
Mutual labels:  bot, minecraft
Minebot
Minebot
Stars: ✭ 119 (+190.24%)
Mutual labels:  bot, minecraft
Matrixcli
Command line matrix client
Stars: ✭ 69 (+68.29%)
Mutual labels:  bot, client
Open Builder
Open "Minecraft-like" game with multiplayer support and Lua scripting support for the both client and server
Stars: ✭ 569 (+1287.8%)
Mutual labels:  minecraft, opengl
Telebot.nim
Async client for Telegram Bot API in pure Nim [Bot API 5.1]
Stars: ✭ 93 (+126.83%)
Mutual labels:  bot, client
Py3 Pinterest
Fully fledged Python Pinterest client
Stars: ✭ 133 (+224.39%)
Mutual labels:  bot, client
Boatapp
Environment for running Minecraft Java Edition on Android
Stars: ✭ 230 (+460.98%)
Mutual labels:  minecraft, opengl
Twitchlib
C# Twitch Chat, Whisper, API and PubSub Library. Allows for chatting, whispering, stream event subscription and channel/account modification. Supports .NET Core 2.0
Stars: ✭ 519 (+1165.85%)
Mutual labels:  bot, client
Ts3audiobot
Advanced Musicbot for Teamspeak 3
Stars: ✭ 397 (+868.29%)
Mutual labels:  bot, client
Bottyclient
A slim Discord client with many cool features including less network traffic which supports bot tokens, but user tokens theoretically work too. Tags: Discord Bot Client Token for Bot Botting Download English
Stars: ✭ 58 (+41.46%)
Mutual labels:  bot, client
Node Minecraft Protocol
Parse and serialize minecraft packets, plus authentication and encryption.
Stars: ✭ 697 (+1600%)
Mutual labels:  minecraft, client
Honeybot
🛩 A python IRC bot with simple plugins dev. Ignited in mauritius, first-timers friendly!
Stars: ✭ 48 (+17.07%)
Mutual labels:  bot, client
Vapor
☁️ Lightweight Steam client framework for node.js
Stars: ✭ 105 (+156.1%)
Mutual labels:  bot, client
Torchbot
A bot for minecraft written in java
Stars: ✭ 47 (+14.63%)
Mutual labels:  bot, minecraft
Lambdaattack
Minecraft bot for servers. Currently supports stress testing. More features are planned
Stars: ✭ 133 (+224.39%)
Mutual labels:  bot, minecraft
Gophertunnel
Toolbox for Minecraft software written in Go
Stars: ✭ 156 (+280.49%)
Mutual labels:  minecraft, client
Quarry
Python library that implements the Minecraft network protocol and data types
Stars: ✭ 182 (+343.9%)
Mutual labels:  minecraft, client
Messenger
Package messenger is used for making bots for use with Facebook messenger
Stars: ✭ 278 (+578.05%)
Mutual labels:  bot, client
Pycraft
Minecraft-client networking library in Python
Stars: ✭ 574 (+1300%)
Mutual labels:  minecraft, client

Linux Windows

Botcraft

Botcraft is a cross-platform C++ library to connect and interact with Minecraft servers with (optional) integrated OpenGL renderer.

This was my first project using OpenGL, multi-threading, networking and "sort-of-complete cmake" so it's a "learn-by-doing" code and many things are probably (really) badly done or should be refactored. Do not hesitate to open an issue or to send a PR if you know how to improve some part of it!

Features

  • Connection to minecraft server (both offline mode and online connection with Mojang account, Microsoft accounts are supported using a json file created by the official launcher)
  • DNS name resolution with and without SRV record
  • All official releases from 1.12.2 to 1.16.5 supported
  • Compression
  • Physics and collisions
  • (Optional) Rendering of all the blocks (including entity-blocks like chests, banners...)
  • Bot control with mouse and keyboard
  • Path finding
  • Block breaking
  • Inventory managing
  • Block placing
  • Block interaction (button, lever etc...)

Example of pathfinding. Right of the screen is the integrated renderer

Example of block placing and inventory managing. Right of the screen is the integrated renderer

Dependencies

All the libraries are included either directly or as submodules and are built locally automatically (if not already found on your system) so you don't have to do anything.

  • asio
  • picoJson
  • zlib (optional, used only if compression is enabled on your server)
  • openssl (optional, used only if your server is in online mode)

Optional dependencies (needed only if you want to build the OpenGL renderer)

The code is cross-platform and is automatically built on both Windows with Visual 2019 and Linux at each push. It should also work on reasonably older versions of Visual Studio and macOS as well.

Building and Installation

To build the library for the latest version of the game with both encryption and compression support and without OpenGL rendering:

git clone https://github.com/adepierre/Botcraft.git
cd Botcraft
mkdir build
cd build
cmake -DGAME_VERSION=latest -DBOTCRAFT_BUILD_EXAMPLES=ON -DBOTCRAFT_COMPRESSION=ON -DBOTCRAFT_ENCRYPTION=ON -DBOTCRAFT_USE_OPENGL_GUI=OFF ..
make all
make install

You don't have to clone the dependencies manually, cmake will clone the ones you need depending on your build configuration.

Don't forget to change the cmake install directory if you don't want the library to be installed in the default location.

On Windows with Visual, you can replace the last five steps by launching cmake-gui and then compiling the .sln from Visual.

There are several cmake options you can modify:

  • GAME_VERSION [1.XX.X or latest]
  • BOTCRAFT_BUILD_EXAMPLES [ON/OFF]
  • BOTCRAFT_INSTALL_ASSETS [ON/OFF] Copy all the needed assets to the installation folder along with the library and executable
  • BOTCRAFT_COMPRESSION [ON/OFF] Add compression ability, must be ON to connect to a server with compression enabled
  • BOTCRAFT_ENCRYPTION [ON/OFF] Add encryption ability, must be ON to connect to a server in online mode
  • BOTCRAFT_USE_OPENGL_GUI [ON/OFF] If ON, botcraft will be compiled with the OpenGL GUI enabled
  • BOTCRAFT_USE_IMGUI [ON/OFF] If ON, additional information will be displayed on the GUI (need BOTCRAFT_USE_OPENGL_GUI to be ON)

Examples

Examples can be found in the Examples folder:

  • 0_HelloWorld: Connect to a server, sends Hello World! in the chat then disconnect
  • 1_UserControlledExample: Best with GUI, mouse and keyboard controlled player. Can be used in a dummy world (without any server) to test things like physics or rendering
  • 2_ChatCommandExample: Simple bot that obey commands sent through vanilla chat. Known commands at this point:
    • pathfinding
    • disconnecting
    • checking its sourroundings for spawnable blocks (useful if you want to check whether or not a perimeter is spawn proof)
    • placing a block
    • interacting with a block (lever, button ...)
  • 3_SimpleAFKExample: Simple example to stay at the same position. Physics is not processed, chunks are not saved in memory to save RAM.

Connection

If the server is in online-mode: false mode, you can connect with any username.

If the server is in online-mode: true mode, you can connect with a Mojang account (login+password) or with a json file created by the official minecraft launcher launcher/install/path/launcher_accounts.json. For users with a Microsoft account, only the second option is available, as implementing the full Microsoft oauth procedure would be rather complicated and tedious.

To-do list

It's only a free time project, but there are still a lot of things to do! Right now the only usecase is an AFK bot to activate a farm with almost 0% usage of CPU/GPU. The next step is to add some functionalities like entities handling/rendering, attacking, crafting... Everything needed to automate more tasks in survival vanilla Minecraft!

There are also some minor improvements to existing features that have to be done:

  • Improve water/lava/ladder physics (the player can walk on fluids and can't climb the ladders)
  • Improve pathfinding with real colliders (the pathfinding considers every solid block as box of size 1 but the collisions are computed with the real shapes which lead to bad situations, for example with fences)

License

GPL v3

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].