-1

For a system I need a hopper check and check which type of wool is inside the hopper so I tried this: (I execute the command in chat while I was standing on top of the hopper)

/testforblock ~ ~-1 ~ minecraft:hopper -1 {Items: 
{Slot:0b,id:"minecraft:wool",Count:1b,Damage:0s}}

Output:

The Block at 3 50 20 did not have the required NBT keys

So I looked on internet but it still didn't work, so can anyone tell me what I am doing wrong? I need help with the DataTag, but if anything else is wrong tell me.

Inside the hopper...

  • But you're also not an expert. I can see this because you use /testfor. ;) – Fabian Röling Apr 20 '18 at 16:08
  • /testforblock and lol i'm a command expert you should see some of my build haha you'll change your mind ;P – Khoeckman Apr 20 '18 at 16:11
  • Do you use comparators or restone dust in them? – Fabian Röling Apr 20 '18 at 16:12
  • 1
    normally not I also 've create a switch and other statements commandblocks so i actually dont use redstone i can use /blockdata – Khoeckman Apr 20 '18 at 16:13
  • You could put a link to your Minecraft forum profile or other website into your profile. That way we don't talk too much offtopic in the comments (what they are not made for). – Fabian Röling Apr 20 '18 at 16:14
1

That error message is really unintuitive, because what it should tell you is that the NBT has a syntax error. Items is an array tag, so you need []:

/testforblock ~ ~-1 ~ minecraft:hopper -1 {Items:[{Slot:0b,id:"minecraft:wool",Count:1b,Damage:0s}]}
  • omg yes i forgot them -_- – Khoeckman Apr 20 '18 at 16:14
  • THX lol i use them all the time, the best can make stupid mistakes ;PPP – Khoeckman Apr 20 '18 at 16:15
  • 1
    I mean, it's not really a syntax error. What he entered is perfectly valid NBT, it's just not the right NBT. – AjaxGb Apr 20 '18 at 17:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.