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

query.is_item_name_any('slot.inventory', 0, 'item:name') not workng for entities

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • None
    • 1.21.60.24 Preview, 1.21.51 Hotfix
    • None
    • Unconfirmed
    • Multiple

      There are entities like Villagers or Minecarts With Chest with the minecraft:inventory component, but the Molang query.is_item_name_any('slot.inventory', 0, 'item:name') only works with players [minecraft:player] and not with the rest of entities despite also having inventory.

      Steps to Reproduce:

      1. Select an entity with minecraft:inventory component such as a Villager or a Minecart With Chest, or create a custom entity and add the component to it.
      2. In the resource bundle, use the Molang query.is_item_name_any function on animations or textures, for example:
        "animate": [
            {"animation": "query.is_item_name_any('slot.inventory', 0, 'minecraft:stone')"}
        ]
      3. In game, put the stone in the first slot of the entity's inventory, you can put it directly or use the command:
            /replaceitem @e slot.inventory 0 stone

      Observed Results:
      Animation never takes place => query.is_item_name_any('slot.inventory', 0, 'minecraft:stone') is not working.

      Expected Results:
      The animation is played when stone is placed in the first slot of an entity's inventory => query.is_item_name_any('slot.inventory', 0, 'minecraft:stone') is true when there is stone in the first slot and false when is not.

      Notes:

      If you do the same with a player the query works, it does not work with the other entities that have inventory.

      Documentation:

      minecraft:inventory

      query.is_item_name_any

      query.is_item_name_any - wiki.bedrock.dev

            MurphyLaw_02 Murphy
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: