1
# usage in selectors
I'm trying to make a command that runs on a few items at ones from a selector using tags.
I created a tag in my Datapack called stuff (shield, dirt, emerald, iron hoe), and I want to run an execute when someone has that item in their inventory.
I tried:
I was wondering: is it even possible to use tags like this in NBT inventory checks within selectors?
Thx for any help!
I created a tag in my Datapack called stuff (shield, dirt, emerald, iron hoe), and I want to run an execute when someone has that item in their inventory.
I tried:
execute as @a[nbt={Inventory:[{id:"#mypack:stuff "}]}] run say Hi
But it doesn't seem to work.I was wondering: is it even possible to use tags like this in NBT inventory checks within selectors?
Thx for any help!
Create an account or sign in to comment.
3
![Bertiecrafter's Avatar](https://static.planetminecraft.com/files/avatar/1861057_2.png)
As far as I know, predicates (json files that you can then test for in /execute if) are the only place that allow testing for items matching an item tag.
![One_Nose's Avatar](https://static.planetminecraft.com/files/avatar/3046549_0.png)
This is not currently possible. You must go one by one.
If you want to do that several times, just have a tick function that removes from everyone has_stuff tag, than gives it to everyone who has the stuff.
If you want to do that several times, just have a tick function that removes from everyone has_stuff tag, than gives it to everyone who has the stuff.
![DMan16's Avatar](https://static.planetminecraft.com/files/avatar/3019986_7.png)
Well that sucks... thx though
Kinda found a way around it using tags
Kinda found a way around it using tags