This behavior pack detects item amounts in a player's inventory and assigns to a scoreboard objective. You can use the scores target selector argument in your own commands.
You may dowload the latest release from the Releases Page
Add the Item Count add-on to your behavior packs on your world. Behavior packs may disable achievements, but editing the world with an NBT editor can re-enable achievements when uploading your world to a realm.
Re-enable achievements on either pc or mobile with the free NBT editor Dovetail
Scoreboard objectives follow the format of namespace:identifier.
You can target players using the scores selector argument in your commands:
# Target players who have 64 enchanted golden apples
execute as @a[scores={inv:enchanted_golden_apple=64}] run <command>Known Limitations
When a player places items from their inventory into the 2x2 crafting grid or the 3x3 crafting table grid, the script will no longer detect the items in the player inventory. It does, however, detect items in PC players' cursor.
- @mittens4all
- @jeanmajid
- @thejonathanlongly in Bedrock Commands Community Discord
_ _ _ _ _
(_) _ _ | | | | | | |
____ _ _| |_ _| |_ _____ ____ ___| |___| |_____| | |
| \| (_ _|_ _) ___ | _ \ /___)_____ (____ | | |
| | | | | | |_ | |_| ____| | | |___ | | / ___ | | |
|_|_|_|_| \__) \__)_____)_| |_(___/ |_\_____|\_)_)