Add expr to get the show item hover tag for a given item.#8669
Add expr to get the show item hover tag for a given item.#8669sovdeeth wants to merge 4 commits into
Conversation
|
Why not an expression that applies the show_item hover action to a Component? |
Because that would be rather difficult to put into a string with %%. Could be a separate expression though. |
Makes sense. I was worried about the hackiness of returning a minimessage string back to the user, but that's now solved! This seems like a pretty good way of providing components to the user in general, assuming that interpolating it into a minimessage string works like you'd expect. |
This comment was marked as resolved.
This comment was marked as resolved.
|
This is because you're forcing it back into a string before reformatting. If you used component addition, this likely would not be an issue. |
Sure, but how often do you see people use |
Yeah, my point is that to put it into a string, like you're testing, it has to become a string again, there's no way around that. It would be the same if you attached the component to another like skbee does and then serialized it back into a minimessage string to put in another string. It's just unavoidable with the test you're doing. Keeping it as a component doesn't have that issue |







Problem
Creating a hover:show_item tag requires the ability to get a string representation of all the necessary components of an item, which is not simple in Skript. See https://docs.papermc.io/adventure/minimessage/format/#hover for details.
Solution
Adds a property expression

item hover text of %itemstacks%that automatically produces the tag"<hover:show_item:...>"for those items.Testing Completed
Added simple regression tests.
Supporting Information
Completes: none
Related: none
AI assistance: none