A collection of Rust crates for making Minecraft bots, clients, and tools.
Find a file
2022-04-26 15:33:41 +00:00
.vscode simplify error handling 2022-04-22 04:33:58 +00:00
azalea-auth ENCRYPTION WORKS!!!!!!!!!!! 2022-04-24 22:46:41 -05:00
azalea-brigadier simplify error handling 2022-04-22 04:33:58 +00:00
azalea-chat simplify error handling 2022-04-22 04:33:58 +00:00
azalea-client default implementation for read and write Vec<T> 2022-04-26 15:33:41 +00:00
azalea-core work on adding more stuff for recipes 2022-04-26 15:13:47 +00:00
azalea-nbt fix warnings in azalea-nbt 2022-04-24 14:56:46 -05:00
azalea-protocol default implementation for read and write Vec<T> 2022-04-26 15:33:41 +00:00
bot Merge branch 'main' into auth 2022-04-24 17:37:57 -05:00
.gitignore simplify error handling 2022-04-22 04:33:58 +00:00
.gitpod.yml simplify error handling 2022-04-22 04:33:58 +00:00
Cargo.lock work on adding more stuff for recipes 2022-04-26 15:13:47 +00:00
Cargo.toml simplify error handling 2022-04-22 04:33:58 +00:00
README.md write example code 2022-04-25 16:18:12 +00:00

Azalea

A Rust library for creating Minecraft bots.

I named this Azalea because it sounds like a cool word and this is a cool library. This project was heavily inspired by PrismarineJS.

Goals

  • Do everything a vanilla client can do
  • Be easy to use
  • Bypass most/all anticheats
  • Support the latest Minecraft version
  • Be fast

Example code

Note that this doesn't work yet, it's just how I want the API to look.

use azalea::{Bot, Event};

let bot = Bot::offline("bot");
// or let bot = azalea::Bot::microsoft("access token").await;

bot.join("localhost".try_into().unwrap()).await.unwrap();

loop {
    match bot.recv().await {
        Event::Message(m) {
            if m.username == bot.username { return };
            bot.chat(m.message).await;
        },
        Event::Kicked(m) {
            println!(m);
            bot.reconnect().await.unwrap();
        },
        _ => {}
    }
}

You can use the azalea::Bots struct to control many bots as one unit.

use azalea::{Bot, Bots, Event, pathfinder};

#[tokio::main]
async fn main() {
    let bots = Bots::new();

    for i in 0..10 {
        bots.add(Bot::offline(format!("bot{}", i)));
    }

    bots.join("localhost".try_into().unwrap()).await.unwrap();

    bots.goto(pathfinder::GotoGoal(azalea::BlockCoord(0, 70, 0))).await;

    // destroy the blocks in this area and then leave

    bots.fill(
        pathfinder::FillGoal(
            azalea::BlockCoord(-5, 60, -5),
            azalea::BlockCoord(5, 70, 5)
        ),
        azalea::block::Air
    ).await;
}