TransWikia.com

How do I test for two items in one Command Block?

Arqade Asked by Ghost Gaming on March 26, 2021

I want to test for two items in one Command Block. I tried this command:

execute if entity @e[type=item,dx=-2,dy=6,dz=-2,nbt={Item:{id:"minecraft:quartz"}}]

That is for just one item. How do I add a second one?

2 Answers

If you are using a command block, just press Enter and then type your second command.

Answered by Potterton on March 26, 2021

Add another if clause to your /execute:

execute
  if entity @e[type=item,dx=-2,dy=6,dz=-2,nbt={Item:{id:"minecraft:quartz"}}]
  if entity @e[type=item,dx=-2,dy=6,dz=-2,nbt={Item:{id:"minecraft:gold_block"}}]
run …

Answered by ExpertCoder14 on March 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