#Detecting if entity has an item with nbt()

3 messages · Page 1 of 1 (latest)

tepid relic
#

I'm trying to detect if a pillager has a crossbow using the nbt() function, but I can't work out the exact formatting. I'm pretty sure it's something like nbt(HandItems.*,print:raw:regex:id:\"minecraft:crossbow\".*)

What's it supposed to be?

#

Also it might need a count:1 in there somewhere, but I can't work out where because I can't have another comma in there.

tepid relic
#

Never mind I worked it out. It was: nbt(HandItems.*,regex:.*id:\"minecraft:crossbow\".*)