mojira.dev
MCPE-172488

comparing #item_text with a similar string results in false

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:

  1. Create a resource pack that can use JSON UI's

  2. Create a UI element in hud_screen.json

  3. Create a binding that has the binding name of #item_text

  4. Make another binding that compares #item_text with an item name that the player can hold

  5. Attach the binding to the elements visibility

  6. 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

To replicate the newline character, use "\n". ;D

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

⚠️ Please do not add Affected Versions to resolved reports.

Have a look at the Resolution and the comments to see why this ticket has been resolved. If you think this ticket has been resolved erroneously you can contact the Mojira staff on Discord or Reddit.

-- I am a bot. This action was performed automatically! If you think it was incorrect, please notify us on Discord or Reddit

Protoplosion

(Unassigned)

Unconfirmed

Windows

Windows 10

1.20.1 Hotfix

Retrieved