Hey Guys. I was just wondering if you can use /testforblock command to test for things like chests with items in them. Like testing for a chest with a diamond sword in it. It looks like you should be able to because the syntax is /testforblock <x> <y> <z> <tilename> [datavalue] [datatag]. So it looks like you should be able to use data tags. So am I doing something wrong? I'm actually trying to test for items in a hopper, but it should still work the same way.
Hey Guys. I was just wondering if you can use /testforblock command to test for things like chests with items in them. Like testing for a chest with a diamond sword in it. It looks like you should be able to because the syntax is /testforblock <x> <y> <z> <tilename> [datavalue] [datatag]. So it looks like you should be able to use data tags. So am I doing something wrong? I'm actually trying to test for items in a hopper, but it should still work the same way.
The command itself is correct. Are your coordinates correct? What error is shown in the interface?
It says "The block at 158,64,121 did not have the required NBT keys."
I'm not sure if the "tag" tag has to have a character or letter to make it work like how Slot has a "b".
It says "The block at 158,64,121 did not have the required NBT keys."
I'm not sure if the "tag" tag has to have a character or letter to make it work like how Slot has a "b".
If you're using mods to manipulate command blocks, I can't help you. Most I can say is: check your chest. There should be a single nametag named "Key A" in the very first slot. Otherwise the command works, as long as the chest matches. Swapping out /testforblock with /setblock (and adding the replace method) works fine, /setblocking the chest as intended.
If you're using mods to manipulate command blocks, I can't help you. Most I can say is: check your chest. There should be a single nametag named "Key A" in the very first slot. Otherwise the command works, as long as the chest matches. Swapping out /testforblock with /setblock (and adding the replace method) works fine, /setblocking the chest as intended.
I'm not actually using the filter, I just used the information from the page. I'll keep fooling around and see what happens, but thanks for the help
This is what I've tried so far:
/testforblock 964 56 -635 154 0 {Items:[{id:280,Slot:0,Count:1}]}
/testforblock 964 56 -635 154 0 {Items:{id:280,Slot:0,Count:1}}
/testforblock 961 56 -635 154 0 {Item:[id:280]}
I've been stumped on this for a while, so if you know the answer or can help please reply below! Thanks!
It's an unfortunate bug with the snapshots. I recommend upvoting the bug report here: https://mojang.atlassian.net/browse/MC-30976
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
/testforblock 158 64 121 chest 3 {Items:[0:{id:421s,Slot:0b,Count:1b,Damage:0s,tag:{display:{Name:Key A}}}]}
I'm not sure what I have to add to the compound tag to make it work.
The command itself is correct. Are your coordinates correct? What error is shown in the interface?
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
It says "The block at 158,64,121 did not have the required NBT keys."
I'm not sure if the "tag" tag has to have a character or letter to make it work like how Slot has a "b".
I found this nbt chest filter that someone made. There's a section that tells you what you're suppose to add to each data type. For a tag compound it says: Compound: Specify on tags separated by '.'
http://www.minecraftforum.net/topic/2038662-mcedit-filter-nbt-chest-nbt-tags-batch-editing/
If you're using mods to manipulate command blocks, I can't help you. Most I can say is: check your chest. There should be a single nametag named "Key A" in the very first slot. Otherwise the command works, as long as the chest matches. Swapping out /testforblock with /setblock (and adding the replace method) works fine, /setblocking the chest as intended.
Minecraft-things: http://skylinerw.com
More Minecraft-things: https://sourceblock.net
Guides for command-related features (eventually moving to Source Block): https://github.com/skylinerw/guides
I primarily hang out in the /r/MinecraftCommands discord, where there's a lot of people that help with commands: https://discord.gg/QAFXFtZ
Their corresponding subreddit: https://www.reddit.com/r/MinecraftCommands/
I'm not actually using the filter, I just used the information from the page. I'll keep fooling around and see what happens, but thanks for the help
Oh! I figured it out! Type /testforblock 964 56 -635 (Block) 0 {Items:[{id:Item,Slot:0b,Count:1b}]} add b after the last two numbers!
I have figured out how to make it work.
Your guys' problem was that you needed to change "id:Item" to "id:minecraft:Item". It doesn't like not having minecraft in there.
And with that being said... You can also add a tag to test for its' name!
I don't have much experience with command blocks, but I'm pretty sure those are different. Datatags use the IDs and spawning items use the names.
Datatag:
Spawning:
All around me are familiar faces...
How do I know which slot is which?
My command isn't working:
/testforblock 30 56 -1124 minecraft:chest 2 {Items:[{Slot:0b,id:minecraft:stone,Count:1}]}
I have 1 stone block in the first slot, the chest is facing the right way, but I run the command and I get:
The block at 30,56,-1124 did not have the required NBT keys.
Any help would be appreciated. Thanks.
You have to write the command like this I think:
/testforblock 30 56 -1124 minecraft:chest -1 {Items:[{Slot:0b,id:"minecraft:stone",Count:1b}]}
or
/testforblock 30 56 -1124 minecraft:chest 2 {Items:[{Slot:0b,id:"minecraft:stone",Count:1b}]}
Hope this helped!
Thanks SuperBlock1! This really helped!
Now how would i testfor a complicated item such as
skull 1 3 {display:{Name:"Quartz Arrow Left"},SkullOwner:{Id:"4d35f021-81b6-44ee-a711-8d8462174124",Properties:{textures:[{Value:"eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvNWYxMzNlOTE5MTlkYjBhY2VmZGMyNzJkNjdmZDg3YjRiZTg4ZGM0NGE5NTg5NTg4MjQ0NzRlMjFlMDZkNTNlNiJ9fX0="}]}}}
how would i go about doing that?
Benjaminian, to do that use tag:{NBTDATA} next to where Damage and Count would be
does anyone know what i dit wrong?
/testforblock -211 79 274 minecraft:chest -1 {Items:[{id:"minecraft:tripwire_hook"},tag:{display:{Name:"Wood Crate Key"},tag:{ench:[{id:16s,lvl:1s}}}]}
(sorry bad english)
/testforblock is not even in the game anymore
yes it is (in 1.12)