Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Any way to break blocks? #305

Closed
ghost opened this issue Aug 3, 2017 · 6 comments
Closed

Any way to break blocks? #305

ghost opened this issue Aug 3, 2017 · 6 comments
Labels
rejected:duplicate Duplicate of an existing issue

Comments

@ghost
Copy link

ghost commented Aug 3, 2017

Hey, im interested in seeing if there is any way to break blocks, probably I would use a C# Script... Im somewhat new to coding and dont really understand how everything works but Im sure if I get pointed in the right direction then I'll be able to figure it out

@Pokechu22
Copy link
Contributor

Breaking blocks in the world isn't currently supported if I recall correctly.

@ghost
Copy link
Author

ghost commented Aug 3, 2017

Breaking blocks in the world isn't currently supported if I recall correctly.

The block I would need to break is sugarcane, so I believe its pretty simple just one block break packet or something, or is sugarcane the same as all the other blocks?

@Pokechu22
Copy link
Contributor

Sugar cane (and other instant-minable blocks) should just be one packet (I think, might be 2 still; the packet is complicated and has several states); it's just that none of the infrastructure to send block break packets has been written yet (so it's not easilly accessible to scripts).

@ghost
Copy link
Author

ghost commented Aug 3, 2017

Sugar cane (and other instant-minable blocks) should just be one packet (I think, might be 2 still; the packet is complicated and has several states); it's just that none of the infrastructure to send block break packets has been written yet (so it's not easilly accessible to scripts).

@Pokechu22 How much work would it be to add this in? Pretty much I'm trying to make a bot run around a sugar cane farm breaking the cane... The walking part I think i have handled but the breaking is the part I'm stuck on.

@ORelio
Copy link
Member

ORelio commented Aug 3, 2017

Hello,

The main issue with block breaking/placing is that #205 would need to be implemented first. Of course, breaking a block does not necessarily requires handling inventory, but handling inventory would allow selecting the right tool to break the block.

Breaking block could be implemented separately if you need it, but to do it properly, digging times would need to be implemented, also the player head would need to be rotated to look at the target block. Failing to implement head movements and digging times would trigger anti-cheat plugins on many servers. Also, the necessary bot API method(s) would need to be added in order to enable bots to break blocks :)

Breaking sugar cane is simple indeed as no block break delay is necessary, still, it requires at least looking at the sugar cane and sending the packet. Plus some testing, I guess. So the necessary work would be the following:

1/ Implement ability to look at specific block coordinates (compute & send packet)
2/ Implement ability to send block break start & block break end (with auto-send block break end at a later time computed depending on block type...!)
3/ Implement ChatBot method to tell the bot to break a block at the specified location, which would automatically check if this is feasible (block near enough & visible to the player) and do the actual thing

There are lots of "would" in this message as I'm not having enough time to work on all of this myself at the moment, I can however provide guidance if you are willing to contribute to the project 🙂

@TheSnoozer
Copy link
Contributor

Hi thanks for the issue,
Since this is somewhat a duplicate, I'm closing this and see this issue tracked inside #205.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
rejected:duplicate Duplicate of an existing issue
Projects
None yet
Development

No branches or pull requests

3 participants