1

# usage in selectors

1 emeralds3 replies46 views
DMan16 started 06/23/2020 5:23 pm
Bertiecrafter replied 06/29/2020 7:57 am
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:
execute as @a[nbt={Inventory:[{id:"#mypack:stuff "}]}] run say HiBut 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!
Posted by avatar
DMan16
Level 1 : New Crafter
0

3 replies

1
06/29/2020 7:57 am
Level 55 : Grandmaster Cyborg
Bertiecrafter
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.
2
06/24/2020 6:39 am
Level 35 : Artisan Pyro
One_Nose
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.
1
06/24/2020 7:47 amhistory
Level 1 : New Crafter
DMan16
Well that sucks... thx though
Kinda found a way around it using tags
Planet Minecraft Logo

Website

© 2010 - 2020
www.planetminecraft.com

Welcome