azalea-rs / azalea

A collection of Rust crates for making Minecraft bots, clients, and tools.
https://azalea.matdoes.dev
MIT License
361 stars 48 forks source link

Added Left Click Mine Functionality #156

Closed AS1100K closed 1 month ago

AS1100K commented 2 months ago

What this PR does?

This PR, will introduce a function in azalea::Client i.e. left_click_mine, once it is enabled it will make the bot mine the blocks it is looking at if it is within it's range In simpler words, it is a simple left-click implementation for mining blocks.

Why this was added?

Although, it is quite basic functionality which could be used either for digging tunnels, mining stones in stone generator, etc. But I thought having it out of the box supported by azalea would be great, that's why I opened this PR.

Why this PR was not opened on the main branch of azalea?

The main branch currently, supports Minecraft version 1.21 and introduces changes in azalea-client/interact.rs which interferes with left_click_mine. This issue makes left_click_mine not work in 1.21. But I am working on a fix, and will soon open a PR to the main branch.

CuriousCodingCanadian commented 2 months ago

lgtm, even though I have no permissions to say that

AS1100K commented 1 month ago

Should I also open this PR on main branch. Currently the error AlreadyPresentError is thrown but I think this has nothing to do with LeftClickMine.

mat-1 commented 1 month ago

Should I also open this PR on main branch.

Yeah, I forgot that this PR isn't targeted at the main branch, I'd appreciate that.

Currently the error AlreadyPresentError is thrown but I think this has nothing to do with LeftClickMine.

Wdym? Your branch and the main branch both work fine for me (at least when running the testbot example). What's your code that triggers that error?

AS1100K commented 1 month ago

Yeah, I forgot that this PR isn't targeted at the main branch, I'd appreciate that.

I have opened a PR #168 on the main branch.