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

get_equipped_item_name doesn't distinguish between namespaces

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.19.10.20 Preview, 1.17.20.22 Beta, 1.17.10, 1.18.31
    • None
    • Confirmed
    • Windows
    • 578006

      The bug

      The molang query.get_equipped_item_name conflates items in separate namespaces that happen to have the same name. The entire point of namespaces is to allow different items to share a name but still be distinguishable, but this query makes that impossible.

      How to reproduce

      1. Download the attached world
      2. Select the vanilla apple
      3. Deselect it
      4. Select the custom apple (which looks like a heart of the sea)

      Observed results
      Both cause "UNKNOWN APPLE" to be printed to chat

      Expected results
      The vanilla apple should cause "VANILLA APPLE" to be printed; the custom apple should cause "CUSTOM APPLE" to be printed. Here is the animation controller file:

      {
         "format_version": "1.10.0",
         "animation_controllers": {
            "controller.animation.apple": {
               "states": {
                  "default": {
                     "transitions": [
                        {
                           "vanilla_apple": "query.get_equipped_item_name=='minecraft:apple'"
                        },
                        {
                           "custom_apple": "query.get_equipped_item_name=='custom:apple'"
                        },
                        {
                           "unknown_apple": "query.get_equipped_item_name=='apple'"
                        }
                     ]
                  },
                  "vanilla_apple": {
                     "on_entry": ["/say VANILLA APPLE"],
                     "transitions": [
                        {
                           "default": "query.get_equipped_item_name!='minecraft:apple'"
                        }
                     ]
                  },
                  "custom_apple": {
                     "on_entry": ["/say CUSTOM APPLE"],
                     "transitions": [
                        {
                           "default": "query.get_equipped_item_name!='custom:apple'"
                        }
                     ]
                  },
                  "unknown_apple": {
                     "on_entry": ["/say UNKNOWN APPLE"],
                     "transitions": [
                        {
                           "default": "query.get_equipped_item_name!='apple'"
                        }
                     ]
                  }
               }
            }
         }
      }
      

            tryashtar [Mod] tryashtar
            Votes:
            5 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              CHK: