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

Add the ability to construct a HoverEvent from items #183

Open
kangarko opened this issue Jul 12, 2024 · 5 comments
Open

Add the ability to construct a HoverEvent from items #183

kangarko opened this issue Jul 12, 2024 · 5 comments
Labels
type: enhancement New feature or request

Comments

@kangarko
Copy link

kangarko commented Jul 12, 2024

Since the ItemStack class implements HoverEventSource only on modern Paper, is there a way to show it through Adventure?

With my other reports, Adventure looks like it is mostly broken for 1.7.10-1.8.8.

@kangarko
Copy link
Author

Someone had to implement it by himself, can't this just be ported into adventure-platform? Especially when you advertise 1.7.10+ support.

https://github.com/FunnyGuilds/FunnyGuilds/blob/ffa1976ac2bc6e2c36e6c1ad3366483a4c6407f2/plugin/src/main/java/net/dzikoysk/funnyguilds/shared/adventure/ItemComponentHelper.java#L106

@kezz kezz changed the title 1.8.8: How to display hover event for itemstack? Add the ability to construct a HoverEvent from items Jul 12, 2024
@kezz kezz added the type: enhancement New feature or request label Jul 12, 2024
@kezz
Copy link
Member

kezz commented Jul 12, 2024

There is no such API for this at this time. If you wish to open a PR implementing this across adventure-platform, feel free! :D

@kangarko
Copy link
Author

But then why Adventure claims it's 1.8.8 compatible for years when major APIs are missing? Specifically if the wiki states on all places that 1.7.10+ is supported then it should be in alignment with that statement

@kangarko kangarko changed the title Add the ability to construct a HoverEvent from items Add the ability to construct a HoverEvent from items for legacy Minecraft versions Jul 12, 2024
@kezz kezz changed the title Add the ability to construct a HoverEvent from items for legacy Minecraft versions Add the ability to construct a HoverEvent from items Jul 12, 2024
@kezz
Copy link
Member

kezz commented Jul 12, 2024

The Adventure API does not have any representation of an "item" and therefore there is no support for such a thing in adventure-platform. 1.7.10+ is supported, but that doesn't mean that every single element of the entire game is supported obviously. Item hover events are just one of those things that aren't natively supported in the API. Of course, you can easily construct your own item hover events using the methods provided, similar to the code you linked earlier.

Please don't change the title of this issue back as you are specifically asking for new API that does not exist to be created for all versions.

@kangarko
Copy link
Author

The adventure-platform is specifically written to bridge Bukkit/Spigot/Paper to Adventure, hence I suggest the method to convert an ItemStack into the object that Adventure works with.

I changed the title intentionally because imho the logical outcome of a lack of this method is downstream incompatibility.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants