Giter Club home page Giter Club logo

azalea's Introduction

Azalea

docs.rs

A collection of Rust crates for making Minecraft bots, clients, and tools.

Azalea

Currently supported Minecraft version: 1.21.

Warning

Azalea is still very unfinished, though most crates are in a somewhat useable state

Features

Docs

The "stable" documentation is available at docs.rs/azalea and the unstable docs are at azalea.matdoes.dev (recommended).

Matrix/Discord

If you'd like to chat about Azalea, you can join the Matrix space at #azalea:matdoes.dev (recommended) or the Discord server at discord.gg/FaRey6ytmC (they're bridged so you don't need to join both).

Goals

  • Do everything a vanilla client can do.
  • Be intuitive and easy to use.
  • Make it easy to have many bots working at the same time.
  • Don't trigger anticheats.
  • Support the latest Minecraft version.
  • Be fast and memory efficient.

Non-goals

  • Supporting several versions of Minecraft on the same branch*.
  • Bedrock edition.
  • Graphics.

Branches

There are several branches in the Azalea repository that target older Minecraft versions. Most of them are severely outdated compared to the latest version of Azalea. If you'd like to update them or add more, please open a PR.

azalea's People

Contributors

112batman avatar 1zun4 avatar atomicgamer9523 avatar chemicalxandco avatar dependabot[bot] avatar eightfactorial avatar enderkill98 avatar honbradev avatar loofifteen avatar lucky4luuk avatar mat-1 avatar mythbusters123 avatar nemo157 avatar sculas avatar shaybox avatar stankye avatar thedudefromci avatar urisinger avatar veronoicc avatar xtexchooser avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

azalea's Issues

Random `UnknownPacketId` errors after `ServerboundKeyPacket` is sent

After this is called:
https://github.com/mat-1/azalea/blob/cb001fa341636d1fa6cc186bfd372f092088270c/azalea-client/src/client.rs#L176-L185

azalea panics with errors such as:
Error: UnknownPacketId { state_name: "LoginPacket", id: 9455 }
Error: UnknownPacketId { state_name: "LoginPacket", id: 19 }
Error: UnknownPacketId { state_name: "LoginPacket", id: 94 }

Go to https://www.microsoft.com/link and enter the code AAAAAAAA
2022-10-16T21:55:26.956408Z DEBUG azalea_client::client: Got encryption request
... 10-15 seconds of no activity
thread 'tokio-runtime-worker' panicked at 'Error: UnknownPacketId { state_name: "LoginPacket", id: 94 }', azalea-client/src/client.rs:204:21

The id is always different.
While collecting errors, I also got Error: ConnectionClosed sometimes.

ServerboundHelloPacket leftover data issue

So if you try to parse a ServerboundHelloPacket, it will fail due to
Leftover data after reading packet ServerboundHelloPacket: [186]

image

By disabling the debug assertions

[profile.dev]
debug-assertions = false

we can get a reading of the packet:
1zun4 (0185ac9d-5ec3-204e-9493-3b3b0b8f6c51) is attempting to join **.**.**.**:25565.

Looking at the UUID, we notice that the UUID was not read correctly.
image

I will investigate this further and submit a pull request with a fix.

Chunk Storage Error

I have also spoken about this error in the discord.

While this error, when running in dev profiles crashes the bot but in release profile it throws error as shown in the image below.

image

When this error occurs?

This error occurs when joining a world like 2b2t.org where the server has queue. In the queue, bot receives a a simple text of it's position and no blocks are in the world.

How frustrating it is?

This makes the log file exceptionally large, as the bot is in the queue for around 12 hours.

Error on "ClientboundLevelParticlesPacket" & "ClientboundSoundPacket" & "ClientboundSetEquipmentPacket"

Hello, when my bot is connected to a server, I get a lot of errors of this type that are triggered

�[2m2024-05-23T16:18:47.738638Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: Parse { packet_id: 41, packet_name: "ClientboundLevelParticlesPacket", backtrace: <disabled>, source: Io { source: Error { kind: UnexpectedEof, message: "failed to fill whole buffer" } } }
�[2m2024-05-23T16:18:47.738701Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [120, 0, 0, 0, 3, 63, 128, 0, 0, 0, 0, 0, 0, 254, 158, 126, 245, 86, 53, 252, 72], packet_name: "ClientboundSoundPacket" }
�[2m2024-05-23T16:18:47.739279Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [4, 62, 25, 153, 154, 63, 190, 251, 240, 192, 65, 214, 180, 4, 24, 39, 62], packet_name: "ClientboundSoundPacket" }
�[2m2024-05-23T16:18:47.764415Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764475Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764483Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [116, 244, 245, 62, 202, 202, 203, 62, 12, 140, 141, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764489Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764495Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764500Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [116, 244, 245, 62, 202, 202, 203, 62, 12, 140, 141, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764506Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [116, 244, 245, 62, 12, 140, 141, 61, 160, 160, 161, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764512Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [116, 244, 245, 62, 202, 202, 203, 62, 12, 140, 141, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764517Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764523Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764553Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [116, 244, 245, 62, 12, 140, 141, 61, 160, 160, 161, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.764559Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: LeftoverData { data: [119, 247, 248, 63, 20, 148, 149, 61, 232, 232, 233, 63, 128, 0, 0], packet_name: "ClientboundLevelParticlesPacket" }
�[2m2024-05-23T16:18:47.598292Z�[0m �[31mERROR�[0m �[2mazalea_client::packet_handling::game�[0m�[2m:�[0m failed to read packet: Parse { packet_id: 91, packet_name: "ClientboundSetEquipmentPacket", backtrace: <disabled>, source: InvalidUtf8 { bytes: [224, 144, 125, 9, 220, 122, 124, 31, 211, 1, 8, 116, 101, 120, 116, 117, 114, 101, 115, 168, 1, 101, 51, 82, 108, 101, 72, 82, 49, 99, 109, 86, 122, 79, 110, 116, 84, 83, 48, 108, 79, 79, 110, 116, 49, 99, 109, 119, 54, 73, 109, 104, 48, 100, 72, 65, 54, 76, 121, 57, 48, 90, 88, 104, 48, 100, 88, 74, 108], lossy: "��}\t�z|\u{1f}�\u{1}\u{8}textures�\u{1}e3RleHR1cmVzOntTS0lOOnt1cmw6Imh0dHA6Ly90ZXh0dXJl" } }

Removing entity from Chunk it's not in

When an entity goes outside the render distance of the bot while another player is present it will occasionally trigger this warning message:

WARN azalea_entity::plugin::indexing: Tried to remove entity 3v3 from chunk ChunkPos { x: 0, z: 0 } but the entity was not there.

The warning comes from this line. It triggers in the cases of:

  • A creature or player (including itself) dies.
  • A creature or player goes outside the render distance (at least vertically as far as I've tested).

It's not a huge deal but I saw it and thought I'd see what I could come up with.

`SwarmEvent` should have either a periodic or “tick” option.

Right now, the events that a bot swarm has consists of Login, Init, Disconnect, and Chat. However, there should also be an Interval or Tick event, for when you want to do something with the swarm (like add a new account) and not have to wait for an event like Chat or Disconnect to be triggered, but rather have a period event that will go off.

Build failed (E0554, E0658)

error: failed to run custom build command for `azalea v0.9.0 (https://github.com/azalea-rs/azalea#4f288b1c)`

Caused by:
  process didn't exit successfully: `E:\azaleatest\target\debug\build\azalea-f068c0b71e7a1d72\build-script-build` (exit code: 101)
  --- stderr
  thread 'main' panicked at C:\Users\Admin\.cargo\git\checkouts\azalea-cdffe42e9d507c39\4f288b1\azalea\build.rs:4:55:
  called `Result::unwrap()` on an `Err` value: NotPresent
  note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
warning: build failed, waiting for other jobs to finish...
error[E0554]: `#![feature]` may not be used on the stable release channel
 --> C:\Users\Admin\.cargo\git\checkouts\simdnbt-6350c7beb21f1e0d\4594562\simdnbt\src\lib.rs:2:12
  |
2 | #![feature(portable_simd)]
  |            ^^^^^^^^^^^^^

error[E0554]: `#![feature]` may not be used on the stable release channel
 --> C:\Users\Admin\.cargo\git\checkouts\simdnbt-6350c7beb21f1e0d\4594562\simdnbt\src\lib.rs:3:12
  |
3 | #![feature(array_chunks)]
  |            ^^^^^^^^^^^^

error[E0658]: use of unstable library feature 'slice_first_last_chunk'
  --> C:\Users\Admin\.cargo\git\checkouts\simdnbt-6350c7beb21f1e0d\4594562\simdnbt\src\mutf8.rs:28:40
   |
28 |         (chunk, remainder) = remainder.split_first_chunk::<16>().unwrap();
   |                                        ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #111774 <https://github.com/rust-lang/rust/issues/111774> for more information

error[E0658]: use of unstable library feature 'slice_first_last_chunk'
  --> C:\Users\Admin\.cargo\git\checkouts\simdnbt-6350c7beb21f1e0d\4594562\simdnbt\src\mutf8.rs:39:40
   |
39 |         (chunk, remainder) = remainder.split_first_chunk::<8>().unwrap();
   |                                        ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #111774 <https://github.com/rust-lang/rust/issues/111774> for more information

error[E0658]: use of unstable library feature 'slice_first_last_chunk'
  --> C:\Users\Admin\.cargo\git\checkouts\simdnbt-6350c7beb21f1e0d\4594562\simdnbt\src\mutf8.rs:50:40
   |
50 |         (chunk, remainder) = remainder.split_first_chunk::<4>().unwrap();
   |                                        ^^^^^^^^^^^^^^^^^
   |
   = note: see issue #111774 <https://github.com/rust-lang/rust/issues/111774> for more information

Some errors have detailed explanations: E0554, E0658.
For more information about an error, try `rustc --explain E0554`.
error: could not compile `simdnbt` (lib) due to 5 previous errors

Here's the main.rs I'm using.
https://pastebin.com/AAAKEf0A

And Cargo.toml.
https://pastebin.com/suyEb2vd

(Also I did:

rustup install nightly
rustup default nightly
rustup override set nightly

And I'm using cargo build)

Add ChatEx support

WARN azalea_chat::component: couldn't parse NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(""))), (Mutf8Str("extra"), List(Compound([NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("Ⓖ "))), (Mutf8Str("color"), String(Mutf8Str("green")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(" "))), (Mutf8Str("color"), String(Mutf8Str("white")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("| "))), (Mutf8Str("color"), String(Mutf8Str("green"))), (Mutf8Str("bold"), Byte(1))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("["))), (Mutf8Str("color"), String(Mutf8Str("dark_gray")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("Игрок"))), (Mutf8Str("color"), String(Mutf8Str("gold")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("]"))), (Mutf8Str("color"), String(Mutf8Str("dark_gray")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(" "))), (Mutf8Str("color"), String(Mutf8Str("white"))), (Mutf8Str("bold"), Byte(1))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(""))), (Mutf8Str("color"), String(Mutf8Str("dark_aqua"))), (Mutf8Str("extra"), List(Compound([NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("ZewI0"))), (Mutf8Str("obfuscated"), Byte(0)), (Mutf8Str("clickEvent"), Compound(NbtCompound { values: [(Mutf8Str("action"), String(Mutf8Str("suggest_command"))), (Mutf8Str("value"), String(Mutf8Str("/msg ZewI0 ")))] })), (Mutf8Str("hoverEvent"), Compound(NbtCompound { values: [(Mutf8Str("action"), String(Mutf8Str("show_text"))), (Mutf8Str("contents"), Compound(NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(""))), (Mutf8Str("extra"), List(String([Mutf8Str("§2§l[§4§lЦезарь§2§l]§f§l §fZewI0"), Mutf8Str("\n"), Mutf8Str(" §fУбийств §8➤ §b0"), Mutf8Str("\n"), Mutf8Str(" §fСмертей §8➤ §c0"), Mutf8Str("\n"), Mutf8Str(" §fВремя в игре §8➤ §e14m"), Mutf8Str("\n"), Mutf8Str(" §fДенег §8➤ §d$8.92M"), Mutf8Str("\n"), Mutf8Str("\n"), Mutf8Str("§c➥ §f§nНажмите, чтобы написать ZewI0")])))] }))] }))] }, NbtCompound { values: [(Mutf8Str(""), String(Mutf8Str(" ")))] }])))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("Кэп! "))), (Mutf8Str("color"), String(Mutf8Str("gray")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str("➯ "))), (Mutf8Str("color"), String(Mutf8Str("dark_red")))] }, NbtCompound { values: [(Mutf8Str("text"), String(Mutf8Str(" кто вместе играть тп!"))), (Mutf8Str("color"), String(Mutf8Str("green")))] }])))] } as FormattedText

disable LogPlugin in a prettier way

Currently, we have to disable the bevy_log plugin with a lot of code

pub fn new_client_builder<S, Fut>() -> ClientBuilder<S, Fut>
where
    S: Default + Send + Sync + Clone + Component + 'static,
    Fut: Future<Output = Result<(), anyhow::Error>> + Send + 'static,
{
    ClientBuilder::new_without_plugins()
        .add_plugins(DefaultPlugins.build().disable::<bevy_log::LogPlugin>())
        .add_plugins(DefaultBotPlugins)
}

and bevy_log must be added as a direct dependency.

Is there a better way to disable it? For example, ClientBuilder::new_without_log()?

Connection refused

Sorry it might be a stupid question
I get a connection refused error in the echo bot example. I did open a local game to LAN, I can't really figure out what happens..

Thanks in advance and thanks for this awesome lib

Auth without remote connect? (feature request/inquiry)

I was wondering if it's currently possible to authenticate/login to an account using the access token/email & passwd without needing to enable remote connect (linking with the code) otherwise I'd like to suggest this as a possible addition.

ClientboundSoundPacket deserialization failure when sent by playsound

Executing commands like execute as <azalea bot> at @s run playsound minecraft:ambient.cave master @s ~ ~ ~ will cause a deserialization error in ClientboundSoundPacket.

Error:
Error reading packet from Client: LeftoverData { data: [0, 0, 2, 48, 255, 255, 255, 244, 63, 128, 0, 0, 63, 128, 0, 0, 63, 103, 41, 228, 92, 95, 200, 35], packet_name: "ClientboundSoundPacket" }

suggestions for code

here are some ideas for things to do all of these should have a minimum of 5 bots

  • stalker
  • protect
  • worldedit
  • litematica

worledit

just the worledit selection that you input on the client and the do like set dirt

stalker

chill at build limit at spawn follow players above build limit 250 blocks around spawn steal shulker and put in ender chest

protect

above build limit above player if player gets attacked come down and attack attacker or if the player attacks someone

feat: Setting properties on a `BlockState` generically

Currently, you need the concrete type of a block to set, for example, the facing.
However, this isn't possible in cases where you don't know the concrete type of a block.
Properties don't have FromStr implemented either, so you can't go from a waterlogged=true to Waterlogged(true).

All in all, this makes it very hard (almost impossible I'd say) to implement a WorldEdit schematic parser, because you can't parse a value like this one: minecraft:birch_stairs[facing=east,half=bottom,shape=straight,waterlogged=false] to it's corresponding BlockState.

My current workaround is to use a LUT, taken from here.

auth customisation options for use outside of Azalea

I am currently looking forward to using azalea-auth for https://github.com/CCBlueX/LiquidLauncher to replace the horrible "miners" library, which has no proper error handling and keeps throwing error codes that a normal user cannot really interpret.

But there is one big problem, and that is that I cannot use my own client ID without forking this repository, and I do not want to use the Nintendo Switch client ID. Also, the fact that you cannot pass your own cache to auth, only a path to an existing cache file, is another thing that would require me to fork it.

Since azalea is more of a library, it makes sense to give the programmer using the library more control without having to fork the repository and change the code.

Reading chat packet failure on all secure servers

When trying to read chat messages from a typical secure server this error is presented:

2024-02-20T21:16:05.420008Z ERROR azalea_client::packet_handling::game: failed to read packet: Parse { packet_id: 105, packet_name: "ClientboundSystemChatPacket", backtrace: <disabled>, source: Custom("couldn't read nbt") }

Here is my code:

use common::{Message, Source};
use lazy_static::lazy_static;
use parking_lot::Mutex;
use azalea::prelude::*;

use std::env;

lazy_static! {
    pub static ref SOURCE: Mutex<Source> = Mutex::new(Source::default());
}

const SERVER_IP: &str = "localhost";

#[tokio::main]
pub async fn main() {
    dotenvy::dotenv().unwrap();

    let email = env::var("MS_EMAIL").unwrap();

    // let account = Account::offline("chattr");
    let account = Account::microsoft(&email).await.unwrap();

    ClientBuilder::new()
        .set_handler(handle)
        .start(account.clone(), SERVER_IP)
        .await
        .unwrap();
}

#[derive(Default, Clone, Component)]
pub struct State {}

async fn handle(bot: Client, event: Event, _state: State) -> anyhow::Result<()> {
    // match event {
    //     Event::Chat(m) => {
    if let Event::Chat(m) = event {
        if let Some(username) = m.username() {
            if username == bot.username() {
                return Ok(());
            }

            let message = Message {
                content: m.content(),
                identifier: username,
            };

            SOURCE.lock().add_message(message);
        }

        println!("{}", m.message().to_ansi());
    }
    // _ => {}
    // }

    Ok(())
}

Bot crash after repeated deaths

Every once in a while when I am bullying my bot by killing it over and over again I get this error:

thread 'tokio-runtime-worker' panicked at C:\Users\user.cargo\git\checkouts\azalea-cdffe42e9d507c39\7fc31f9\azalea-physics\src\collision\world_collisions.rs:18:62:
called Option::unwrap() on a None value
note: run with RUST_BACKTRACE=1 environment variable to display a backtrace
Encountered a panic in system azalea_physics::travel!
tick_run_schedule_loop error: channel closed
thread 'thread 'tokio-runtime-workertokio-runtime-worker' panicked at ' panicked at C:\Users\user.cargo\git\checkouts\azalea-cdffe42e9d507c39\7fc31f9\azalea-client\src\chat.rsC:\Users\user.cargo\git\checkouts\azalea-cdffe42e9d507c39\7fc31f9\azalea-client\src\chat.rs:thread ':174tokio-runtime-worker174:' panicked at :43C:\Users\user.cargo\git\checkouts\azalea-cdffe42e9d507c39\7fc31f9\azalea-client\src\chat.rs43:
::
called Result::unwrap() on an Err value: SendError { .. }174called Result::unwrap() on an Err value: SendError { .. }
:
43:
called Result::unwrap() on an Err value: SendError { .. }
error: process didn't exit successfully: target\debug\Bot.exe (exit code: 0xc000013a, STATUS_CONTROL_C_EXIT)

It seems to be about this line of code. I only get this sometimes when I kill my bot like 4+ times. It also, as seen in the error, crashes the program stopping the bot from running.

bug: panicked at azalea-client/src/events.rs:164:47:

Hello,

https://github.com/azalea-rs/azalea/blob/main/azalea-client/src/events.rs
is filled with .unwrap() instead of handling the error properly.
And there is no way for me to handle any errors from outside.

2024-05-25T00:53:53.371715Z ERROR tokio-runtime-worker swarmcontrol: panicked at /home/izuna/.cargo/git/checkouts/azalea-2c9a2bd95159baf4/a70e0b6/azalea-client/src/events.rs:164:47:
called `Result::unwrap()` on an `Err` value: SendError { .. } panic.file="/home/izuna/.cargo/git/checkouts/azalea-2c9a2bd95159baf4/a70e0b6/azalea-client/src/events.rs" panic.line=164 panic.column=47

This problem occurs on join, which fails on the first tick. It should therefore throw a result immediately instead of causing tokio threads to panic.

Also not sure if it is really caused by azalea, but I keep growing in memory with every new time I join with a new client. I woke up to 64gb of memory filled up and 12 cores at 100% CPU utilization.

Command completions for brigadier

Mojang/brigadier uses getAllUsage, getSmartUsage and getCompletionSuggestions for command completion. But it seems that azalea-brigadier is poor at usage generating.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.