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

hasitem selector not working when testing for air

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • None
    • 1.19.11 Hotfix, 1.19.20
    • None
    • Confirmed
    • Multiple

      What I Expected to Happen (The Bug)

      /say @a[hasitem=\{item=air,location=slot.armor.chest}]

      The above command would be expected to list the names of every online player who has nothing in their chest armor slot, but it doesn't list anyone at all, just making the player running it send a blank /say message.

      Testing for air in any slot will result in the response "No targets matched selector" when using /execute with the sendcommandfeedback gamerule set to true. An example:

      /execute @a[hasitem=\{item=air,location=slot.armor.chest}] ~~~ say No Chestplate

      /execute as @a[hasitem=\{item=air,location=slot.armor.chest}] run say No Chestplate (With Upcoming Creator Features Enabled)

       

      Working Case of hasitem with Iron Chestplates

      /say @a[hasitem=\{item=iron_chestplate,location=slot.armor.chest}]

      The above command works as expected, listing the names of every online player who has an iron chestplate in their chest armor slot in the /say message.

            lammas123 lammas123
            Votes:
            2 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: