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.
Linked issues
duplicates 1
Comments 3
The back slashes were added when I made the report, I'm not sure why, remove those when you paste the command.
Thank you for your report!
We're tracking this issue in MCPE-155675, so this ticket is being resolved and linked as a duplicate.
If you would like to add a vote and any extra information to the main ticket it would be appreciated.
If you haven't already, you might like to make use of the search feature to see if the issue has already been mentioned.
Quick Links:
📓 Bug Tracker Guidelines – 💬 Community Support – 📧 Mojang Support
📓 Project Summary – ✍️ Feedback and Suggestions – 📖 Game Wiki
-- I am a bot. This action was performed automatically! The ticket was resolved by one of our moderators, and I left this message to give more information to you.
Does a syntax error display when you copy and run the exact commands you wrote in the bug, with the \ sign in the middle?