MCBuild is a custom Minecraft client with advanced auto-building functions and some other nice features. Given a build specification and an amount of building materials available in your inventory it can automatically place blocks for you. The auto-building function can be used for mundane building tasks, like filling holes with dirt, or covering roofs with slabs. It can be used for building simple parametric shapes, e.g. floors, walls, rings, spheres. But it also can be used for building complex projects and even redstone mechanisms.
It can directly load and export .schematic format and a couple of others, and also import PNG files as pixel art.
MCBuild is suitable for both survival and creative mode, but works in multiplayer only. It works with Anticheat.
MCBuild is a free and open source software under GPL2 license. The sources are available from Github.
MCBuild uses a somewhat unconventional approach. You see, although it can be considered a "custom client", it's not exactly a stand-alone client like various "hacked clients" you see around. Neither is it a mod. Instead, it's a separately running application that works as a proxy for the MC protocol.
When launched, it creates a kind of a local Minecraft server. You connect to it with your normal Minecraft client and MCBuild connects further to the remote server. Now it sits between your client and the server and by default transparently forwards traffic like a proxy. When some of its functions are active, it will modify the MC protocol traffic, inserting, modifying or dropping messages as needed.
The advantage of this method is - you don't need to abandon your client, or install any mods for it, or require anything special from the server. Any client running 1.8.x/1.9 protocol with any mods is compatible with MCBuild, as well as any 1.8.x/1.9 server. MCBuild has been tested with vanilla and various hacked clients (Huzuni, Wurst, Wolfram, etc.) and with various servers (vanilla, Spigot, PaperSpigot, etc.).
What functions does it provide?
MCBuild's main purpose is auto-building, but it has a couple of other functions, some of them are well known from other hacked clients and mods. They are probably no match to other clients when it comes to hacking or cheats, I merely added them for my own convenience, but then - you can use any client with MCBuild, so the functions can complement each other. Some functions are: Kill Aura, Auto-Shear, Anti-AFK, Auto-Grind, Hole Radar, Align, etc.
The building functions include:
- parametric builds (floor, wall, stairs, scaffolding, ring/disk, sphere/ball)
- recorder (records what you are placing and use it as a template)
- scan (scan existing structure from the surroundings)
- buildplan manipulations (flip, tilt/rotate, trim, hollow, shrink, replace/remove blocks, extend)
- export and import from various file formats (bplan, schematic, csv)
- import from PNG as pixel-art using several material sets (wool, clay, glass)
- building process can be canceled, paused and restarted from old position
- functions to assist building layer-by-layer (useful when you cannot fly)
- in-game preview
MCBuild supports placement of all block types, including those with different item and block IDs (e.g. crops, redstone wire, water/lava) and orientation-dependent blocks (e.g. stairs, slabs, redstone devices). It can also adjust blocks to the needed state after placement (e.g. set delay on the repeaters, turn switches).
What platforms are supported?
Currently 64-bit Linux and Windows are supported. Thanks to Cygwin, there is no special Windows or Linux version necessary - both use exactly the same source code, compiled exactly the same way.
32-bit platforms should work as well, but that wasn't tested for a long time, so I cannot confirm that. Other architectures (e.g. ARM on Raspberry Pie) should work as well, but that wasn't tested - feel free to try.
What about OSX? Good question. OSX is UNIX-based and all the necessary tools and libraries are available - it should just work if you install GCC and other tools, essentially following the Linux installation instructions. Unfortunately I have no experience with OSX and no possibility to test it. If someone's willing to volunteer to test the installation procedure and create an installation guide, I would gladly add it to the documentation.
How do I install it?
If you're comfortable with using Git, C compilers and command line, you can get it directly from Github and compile it from source. Just clone the following repository : https://github.com/broese/mcbuild.git and read the docs for the detailed instructions how to compile it on Linux and Windows. As I mentioned before, a procedure similar to Linux installation process should be easily doable on OSX as well, but since I have no experience with it, I can't provide verified instructions.
If you're on 64-bit Windows (W7/8/10) and want to have it quick and easy - there's a pre-built package for you:
- Unpack the archive to C:\ (it should create C:\cygwin64\ folder with other files within)
- Start cygwin.bat inside the folder
- type mcb_update and press enter to update to the newest version after installation
- Read the docs from C:\cygwin64\home\YOURNAME\mcbuild\docs on how to configure your Minecraft client.
If in doubt you can also watch the installation tutorial video linked at the end of the post.
32-bit package for Windows7 is also available, however unsupported. Use at your own risk. Note that this package probably will not work on Windows XP due to lack of support in the recent versions of Cygwin.
Which Minecraft Versions are supported?
MCBuild currently supports all protocol versions from 1.8 through 1.11. In the recent versions of MCBuild, I have implemented multi-protocol support, which means you no longer need to switch between versions - the protocol version is detected automatically when you connect. The multi-protocol support is available for all protocols 1.9 through 1.11. 1.8 support is not integrated yet, for that particular version you will need to switch to release_1.8 branch. That branch is also a little outdated and does not contain recent features. If you're using the prebuilt package - use mcb_update script to switch between versions (see below).
All branches are still being maintained, i.e. new features developed will be integrated and made available for all minecraft versions 1.8-1.11, as far as possible (some features might be not available due to protocol limitations though). Eventually, support for older branches will be phased out if they become obsolete, but they will be still available for use, just no longer updated.
If you have a working installation, you don't need to reinstall anything to get access to the newest version - just run the update script. The installation package below may seem pretty old, but don't worry - it is still suitable for the installation, you just need to run the update script afterward.
What are those mcb scripts?
They are there for your convenience - to make the updating, installing and launching MCBuild very simple - but you can do all that manually as well, if you're familiar with git. You need to type these commands in your Bash (Linux) or Cygwin (Windows) shell.
mcb_update : update MCBuild to the latest version
As of 2016-04-19, mcb_update takes an optional parameter that allows you to switch between the versions:
mcb_update (w/o args) - update the last version you chose
mcb_update 1.8 - switch to release_1.8 - support for MC1.8 protocol servers and clients
mcb_update dev - switch to the master branch - latest "unstable" development release, currently 1.10 support
mcb_startserver[:port]: launch MCBuild and connect it to server:port or your choice
Read the documentation for more details.
Does it support automatic digging or destruction of blocks? Combat?
No, at the moment there are no such functions. Except for a quite simplistic Kill Aura there are no combat-related functions either. It's all about building and survival, really.
Does it build everything automatically, I don't need to do anything?
No, MCBuild only places blocks that are in reach, and for which it has material. So, your task is still to move around to reach every corner of your build and to load sufficient building material in your inventory. MCBuild will however automatically fetch the necessary materials from your main inventory to your hotbar when building. It also provides information how much material is still required to finish the build.
What's with the weird preview? Sugarcane?
Yes, sugarcane. Unfortunately, MCBuild cannot provide a fancy preview like Schematica does, since it has no access to your GUI - it only operates on MC protocol. So, preview blocks have to be some normal blocks available on the client. Sugarcane is chosen for safety: it is a non-solid block, so if you have a Safewalk feature in your client, it won't try to step on these blocks. With a solid block you would risk to accidentally step on the preview blocks and fall through.
It won't build when I'm flying, jumping, swimming in the water or standing on a ladder
By default, MCBuild temporarily suspends block placement, while player is not in "on ground" state. When you are building in survival, this is useful to move around more freely and safely - a sudden attempt to place block may interrupt your jump, etc. However, in the cases above player is also not "on ground", so you will need to allow building using following command:
#build opt bjump 1
Can I help?
You're welcome to help with development, bug reporting, suggesting new features and improvements, improving documentation, providing tutorials of your own. There's a lot you can help with, but first of all - just use it!
Example survival builds made with MCBuild (on 2b2t.org):
Bump for an update - version 1.0.1 for MC1.8 is released that fixes an issue introduced by Mojang's recent upgrade. Shortly after 1.9 was released, Mojang also upgraded their launcher to 1.6.61, which broke a few things. Although the new launcher is primarily required for MC1.9, it affects MC1.8 as well.
If you're installing it from scratch - grab the v1.0.1.
If you've installed v1.0 previously, you can upgrade it, however you need to do a few things:
you need to install an additional JSON library for Cygwin. For this, download the Cygwin installer from https://cygwin.com/setup-x86_64.exe , start it and when you get to the package selection screen, find exactly this package: Libs/libjson-c-devel (easiest way is to enter libjson-c-devel in the search box) and select it for installation. This procedure will also update your Cygwin installation to the newest version.
Get rid of the old libraries patched by v1.0. If you have the newest Minecraft Launcher (1.6.61), no need to worry about - it will fix the things automatically. If not - update your MC launcher, or run mcb_remove script (now obsolete in MCBuild 1.0.1)
Run mcb_update to update and rebuild MCBuild to the newest version.
Also: I started the development of the next MCBuild version for MC1.9 - expect it in a few days.
Bump for version 1.9 release. There's no extra package for it - just grab the 1.0.1 from the link above and update. MC1.9 version is now default, but you can easily switch between 1.8 and 1.9 versions as needed. Read the OP post.
If you're interested in using it, please don't hesitate to ask. I am more than willing to help and answer any questions.
So I've almost got it working, but I keep coming across an error.
Everytime I try connecting to a server, it just gives me the following:
I'm using 1.8 trying to connect to a 1.8 server.
Also I noticed on the top it says "MCBuild 1.1 for MC Protocol 1.9"
Cannot open file bases.txt for reading: No such file or directory
Cannot open file players.txt for reading: No such file or directory
assertion "key < 32" failed: file "entity.c", line 403, function: read_metadata
/home/MYNAME/bin/mcb_start: line 8: 107384 Aborted (core dumped) ./"$APPNAME" "[email protected]"
Amazing! Must have been quite a challenge to write! I assume you have a CS background? Works as advertised on my Linux machine!
Thank you for trying it out! I do have a CS degree, but I think no college course can replace a 100% privately made project where you have to set your own goals and search for your own mistakes. It's been a challenge, but I got a lot of fun and experience working on it. Also it wouldn't be possible without all the information on Minecraft protocol and data formats people painstakingly collected on the Internet.
Do you have any hints on how to read the source code? Where to start for example?
Sure, I can give you a quick run walk-through on modules:
First thing to consider is libhelper - which is a separate project, a collection of useful functions and macros that is used heavily in MCBuild. Within MCBuild project, there are several modules:
Modules handling minecraft-specific data types:
mcp_types : definitions of various data types used in the Minecraft protocol, such as coordinates, etc
nbt : NBT parser/writer
slot : inventory slots data type and handling functions
entity : entities (mobs and other non-block objects)
Various helper modules:
mcp_ids : tables and constants of various IDs, including packet IDs, block/item IDs, etc. Functions to convert ID to name and vv, and what's important for the building - tables and routines to rotate block meta values.
mcp_arg : commandline parsing in the build commands
mcp_packet : MC protocol packet decoding/encoding - parses the protocol stream to MCPacket structs
mcp_gamestate : a module that collects game information passively, such as block data, entities state, inventory state, etc.
mcp_game : various client functions except building (this is delegated to separate mcp_build module), such as kill aura, hole radar, autoshear, etc.
mcb_build : building functions
mcb_bplan : functions to create and manipulate buildplans
mcproxy : MCBuild main application, handles connection establishment, authentication, encryption and the main loop that pumps MC protocol packets between client and server
mcpdump : Additional tool to analyse .mcs files recorded by MCBuild (they are placed in the saved/ directory) - poorly documented at the moment
The flow of traffic is as follows:
mcproxy takes care of incoming connections, authenticates against the server, and starts pumping messages until connection closes.
When a new message comes in, it tries to decode it using mcp_packet module and gets an MCPacket object.
This object is then passed to mcp_gamestate module to update the passive state - e.g. it stores chunk, entity, inventory changes without affecting these messages in any way.
Then the same packet is passed to mcp_game module, which can actively react on it, triggering certain funtions.
One thing mcp_game handles are the chat messages from the client, that are interpreted as commands if they start with '#'.
Commands that start with '#build' are passed to mcp_build module, which handles build-specific commands.
mcp_build uses mcp_bplan module to create and manipulate buildplans - blueprints for the buildings basically.
mcp_build also uses mcp_arg to parse it's more complex commandline arguments.
If a command is requested, it either performs some action immediately, or defers it to asynchronous execution (which includes things like building, kill aura etc.)
After the packets is processed by these modules it is by default forwarded further, or it can be dropped or modified.
After the packet processing is complete, asynchronous functions can be called in the mcp_game or mcp_build modules.
At low level, the modules use various data formats and functions to handle these from modules mcp_types, mcp_ids, nbt, slot, entity...
Do you think this can be used as a base for an autonomous builder? Or are the challenges to build such a thing too great?
In order to be fully autonomous, the client would need to know how to move around without getting into danger. I think this problem quickly becomes way too complex to implement. This would need a good portion of artificial intelligence needed, which MCBuild does not have at all. I see it merely as an enhancement that can automate mundane tasks
Bump for Minecraft 1.10 support. You can use the same package - as described in the first post, you can freely switch between versions 1.8, 1.9.2, 1.9.4 and 1.10. If you've been using 1.9.4 previously, it will switch to 1.10 automatically when you do mcb_update. If you need to use 1.9.4, do mcb_update 1.9.4 on the commandline. Do mcb_update dev to return to the default 1.10 support.
Hi! I am very excited to use MCBuild, but I can't get it to work properly on my server.
I run and manage my own server on the same computer I play on, which, at the time of this post, is on minecraft version 1.10.2. I installed cygwin, followed the procedure outlined in the documentation, but am confused as to what to put in for the server address. When I connect to my server normally, I just type localhost in the address bar. I tried putting both localhost, and my ipv4 address into the command line, both to no avail. What should I put in instead? Thanks in advance!
I have now included a screenshot of my noip address attempt. I also tried my whatsmyip.org number (not pictured) but it had the same effect. Hopefully the image will be of use.
In your case, MCBuild complains that it can't open the socket - address is in use. MCBuild opens a socket on localhost:25565 and my guess you're running a minecraft server on the same machine, so the port is occupied.
Very simple: run MCBuild on a different port, using:
mcb_start -b 20000 servername.com
This will make MCBuild use port 20000 instead. In your Minecraft client you will also need to adjust the address to 127.0.0.1:20000 to which you connect.
The server name as argument is the address of the server you want to connect. I'm guessing you want to try it on your own local server - then you should put in localhost or 127.0.0.1
Excellent! That worked wonderfully! Thanks for your response and help!
EDIT: Uh-oh! First error, about 4 minutes into connecting to the server.
I had the docs open on one side, and minecraft on the other, when I received the error message on the right, kicking me out of the server. I tried restarting mcbuild, only to get the same error, this time about 10 seconds into connection.
When you start it - the message should read "MCBuild 1.1 for Minecraft 1.10 (protocol v. 210)" - this is the protocol used by Minecraft versions 1.10 through 1.10.2. In your screenshot it was 1.9. MCBuild currently does not check if you're connecting with a wrong client - this is one thing I will fix next.