valence-rs / valence

A Rust framework for building Minecraft servers.
http://valence.rs/
MIT License
2.68k stars 138 forks source link

read-only inventories #427

Open JackCrumpLeys opened 1 year ago

JackCrumpLeys commented 1 year ago

Describe the problem related to your feature request.

Creating a Item menu I noticed that there was no obvious way to disable parts of the inventory system to do with adding and removing items.

What solution would you like?

A flag for inventory to label them as read only to the internal systems to make it so that the menu cannot be modified by anything other than the server. This could be a component or a field in Inventory.

What alternative(s) have you considered?

Re implement all the systems manually for my server, this would be non-ideal.

dyc3 commented 1 year ago

Related to #307

pepperoni21 commented 1 year ago

Ideally there would be an external plugin allowing to make interactive GUIs, which would be possible if we can cancel inventory click events, so this issue could be a starting point https://github.com/valence-rs/valence/issues/399