Mojira Archive
MCPE-189610

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

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

Unresolved

Murphy

2025-01-04, 12:27 AM

2025-01-09, 11:30 PM

0

1

Unconfirmed

1.21.60.24 Preview, 1.21.51 Hotfix

-