Replies: 6 comments
-
Could you perhaps expand on the problems you have with this method? |
Beta Was this translation helpful? Give feedback.
-
in some cases you want reusable inventories or custom inventory holders |
Beta Was this translation helpful? Give feedback.
-
Yeah, applying a custom name is currently very annoying, because you need to override the title in the InventoryOpenEvent, but I already opened a PR that alleviates this problem (#9658).
|
Beta Was this translation helpful? Give feedback.
-
I think anvils are not player but location bound |
Beta Was this translation helpful? Give feedback.
-
This is sadly still an issue. Check my comment here: #5284 (comment) |
Beta Was this translation helpful? Give feedback.
-
Going to close this for now. Upstream has merged in the MenuType API which should solve this, create AnvilView's via that API (once it's upstream'd into paper). |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem?
So, there's been an ongoing issue with Bukkit and anvil inventories that seems to have persisted for quite some time. It's been rather frustrating, to say the least. Essentially, when attempting to create an anvil inventory using Bukkit's createInventory method, things just don't function as expected.
The crux of the problem lies in anvils created this way ending up as type CraftInventoryCustom instead of the expected CraftInventoryAnvil. This leads to a myriad of issues – events fail to trigger properly, and window properties appear to be behaving strangely. It's all quite bothersome.
Currently, the most dependable method to obtain a functional anvil is by utilizing Player#openAnvil. However, let's be honest, that's not a universal solution. There are instances where greater flexibility is required.
Describe the solution you'd like.
It would be incredibly helpful to have a method like Bukkit#createAnvil or perhaps a solution to address the issues in the existing createInventory methods.
Describe alternatives you've considered.
Currently, the way to go is by using NMS, which seems a bit silly for such a simple task.
Other
No response
Beta Was this translation helpful? Give feedback.
All reactions