Uploaded image for project: 'Minecraft (Bedrock codebase)'
  1. Minecraft (Bedrock codebase)
  2. MCPE-172488

comparing #item_text with a similar string results in false

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Incomplete
    • None
    • 1.20.1 Hotfix
    • None
    • Unconfirmed
    • Windows

      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.

        1. observed.png
          observed.png
          1.21 MB
        2. expected.png
          expected.png
          1.19 MB
        3. code.png
          code.png
          12 kB

            Protoplosion Protoplosion
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: