-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Item stack name tooltip API #11033
base: master
Are you sure you want to change the base?
Item stack name tooltip API #11033
Conversation
Welcome to paper 🎉 Thank you for your first PR! Feel free to ask in the discord if you have any questions on the feedback! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs general re-evaluation on its usefulness/api usage.
Given the server has 0 authority over this, the PR adds a nice utility (certainly) but said utility cannot be consistent (as evident by the javadocs).
Needs more input of how worth this utility is.
As someone who does the things mentioned in the PR with the action bar, this is certainly very useful. And it's clearly mentioned in the Javadocs that the server is limited in predicting it. However maybe just exposing itemStackChangeTime directly would make more sense? Then that value could also be used for other things (though I am not sure what those could be), without needing to keep track of it in the ItemHeldEvent |
I feel like publishing both would make the most sense here as it's the best of both worlds |
I think having |
This adds an API for getting whether the current item stack that the player is holding is showing its name as a tooltip. It's important to note that this behavior can be configured via the accessbility settings, under notification time. This is still very useful for server owners, e.g. when you have a UI Overlay in your action bar, which is slightly shifted downwards using fonts, this can collide with the item's name tooltip. But instead, with this API, you can detect if it's shown and then raise the overlay a bit. Here is an example of this in action (not made by me):
avoiding_item_name_tooltip_collisions_with_overlays.mp4