The variable #item_text in hud_screen.json, which is associated with the @hud.item_name_text control, should equal to the item name that the player is holding, but it does not. Instead, it actually equals the name of the item that the player is holding but with an newline at the end that I could not replicate in a string ("\n" for an example).
Steps to Reproduce:
Create a resource pack that can use JSON UI's
Create a UI element in hud_screen.json
Create a binding that has the binding name of #item_text
Make another binding that compares #item_text with an item name that the player can hold
Attach the binding to the elements visibility
In game, hold the chosen item and have the items name appear above hotbar
Expected Result:
The UI element should appear as the item text appears above the hotbar with the name being of the item you chose to compare that you should be holding as well.
Observed Result:
The UI element does not appear once the item text appears above the hotbar that also equals to the item compared that you should be holding.
Attachments
Comments 4
Thank you for your report!
However, this issue has been temporarily closed as Awaiting Response.
Could you please attach an example addon showcasing the issue?
This ticket will automatically reopen when you reply.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📓 Project Summary – 📧 Suggestions – 📖 Minecraft Wiki
Cleaning up old tickets: This ticket had been set to 'Awaiting Response', but has not received a response from the reporter (~3 months+) so is being closed as Incomplete. If you feel this is still a valid issue then please comment, or create a new ticket following the Issue Guidelines which includes steps to reproduce the problem.
Quick Links:
📓 Issue Guidelines – 💬 Mojang Support – 📧 Suggestions – 📖 Minecraft Wiki
To replicate the newline character, use "\n". ;D