TransWikia.com

Minecraft detecting if a player in a certain place has a certain item

Arqade Asked on April 26, 2021

I’m building a city themed parkour map and I’m trying to figure out how to detect if a player is in a certain place and has a certain item in his inventory. I’ve tried using a combination of these two commands:

/execute if entity @p[x=-628,y=120,z=-157,dx=0,dy=0,dz=3]

and

/execute if entity @a[nbt={Inventory:[{id:"minecraft:rabbit_stew"}]}]

but I just can’t figure it out. I’d appreciate your help.

One Answer

Try combining those into one command:

execute if entity @a[x=-628,y=120,z=-157,dx=0,dy=0,dz=3,nbt={Inventory:[{id:"minecraft:rabbit_stew"}]}]

Correct answer by ExpertCoder14 on April 26, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP