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

Feature Request: Inventories & Block Placing/Breaking #205

Closed
AndrewMast opened this issue Sep 29, 2016 · 12 comments
Closed

Feature Request: Inventories & Block Placing/Breaking #205

AndrewMast opened this issue Sep 29, 2016 · 12 comments
Labels
a:new-feature Request for a new feature in:inventory-handling Related to Inventory handling in:terrain-handling Related to terrain and movements resolved The issue has been resolved

Comments

@AndrewMast
Copy link

AndrewMast commented Sep 29, 2016

It would be AWESOME if you can make it process inventories: get slot items (array), and put stuff in slots (from personal inventory), and click on slots

@ReOp14
Copy link

ReOp14 commented Sep 29, 2016

Yeah, it would be pretty cool if there was a development of some inventory processing. However, there is no code ORelio can use to add this ability as far as I know.

@AndrewMast
Copy link
Author

I don't get it?

@Pokechu22
Copy link
Contributor

Inventory management is difficult to write: you have to handle all types of inventories; process a bunch of packets (close window clientbound, open window, window items, set slot, confirm transaction clientbound, confirm transaction serverbound, click window, close window, creative inventory action, and probably others for things I'm not thinking of); handle displaying the actual items (which is particularly hard when you consider the way items are named is somewhat arbitrary and can vary by metadata); and even just displaying it into the console in a useable way. It's not impossible (other clients do implement it), but it does make things difficult and there are a bunch of weird special cases.

@AndrewMast
Copy link
Author

I get that outputting it for the console itself would be hard, but what I'm asking is for the inventory data to be accessible for a script file.

@Pokechu22
Copy link
Contributor

Ah, in a script is easier to implement, though the number of packets still does make it difficult.

@ORelio
Copy link
Member

ORelio commented Sep 29, 2016

Well, inventory handling is already on my TODO list but as @Pokechu22 said that would require a lot of work, if that was not the case, I would already have done it 😆

This was referenced Mar 13, 2017
@ORelio ORelio changed the title FEATURE REQUEST: Inventories Feature Request: Inventories & Block Placing/Breaking Jun 2, 2017
@MattIPv4
Copy link

MattIPv4 commented Jun 2, 2017

Any eta for either part?

@ORelio
Copy link
Member

ORelio commented Jun 2, 2017

Nope, sorry. Don't have time to work on this.

@azoundria
Copy link

azoundria commented Nov 1, 2017

I see the problem in that a full inventory management system is a goliath and impractical undertaking. I think if you could have a simple /drop [#] command, where [#] is the hotbar slot, that would be useful. You could assume the end user already knows ahead of time what item they put in which hotbar slot, and since it's just the hotbar you wouldn't have to open any windows. How much complexity would be involved in something like that?

@TheSnoozer
Copy link
Contributor

As per #305

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 slightly_smiling_face

@ORelio
Copy link
Member

ORelio commented Mar 29, 2020

Hi,
Inventories are handled in the newest development build thanks to @ReinforceZwei 's work.
It is currently not possible to place blocks but you can now list what is in your inventory and click on items in GUI menus.

@ORelio ORelio added in:inventory-handling Related to Inventory handling in:terrain-handling Related to terrain and movements resolved The issue has been resolved and removed waiting-for:contributor Contributions needed and welcome :) labels Aug 20, 2020
@ORelio
Copy link
Member

ORelio commented Aug 20, 2020

MCC is now able to place blocks thanks to @Nekiplay's and @ReinforceZwei's work.
This is mainly done from the Script API, TreeFarmer.cs making a good example.
I think we can finally close this issue 👍

@ORelio ORelio closed this as completed Aug 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
a:new-feature Request for a new feature in:inventory-handling Related to Inventory handling in:terrain-handling Related to terrain and movements resolved The issue has been resolved
Projects
None yet
Development

No branches or pull requests

7 participants