[SPIGOT-1280] The NBT part of testforblock command didn't work correctly Created: 08/Nov/15  Updated: 23/Nov/15  Resolved: 23/Nov/15

Status: Closed
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Weiyuan Zhu Assignee: Unassigned
Resolution: Won't Fix Votes: 0
Labels: nbt, spigot
Environment:

Spigot 1.8.8 5f38d38-18fbb24



 Description   

The testforblock command can test the block without NBT tag like "/testforblock ~ ~1 ~ minecraft:hopper" will return true by comparator. However, when you add any NBT tags like "/testforblock ~ ~1 ~ minecraft:hopper -1 {Items:[

{Slot:0,id:bed,Count:1}

]}" it nolonger work any more.

This issue seems effect other commands like testfor .etc. NBT tag can be applied when setblock or summon something but can not be detected correctly.



 Comments   
Comment by md_5 [ 23/Nov/15 ]

Command testfor is not modified by Spigot

Comment by Weiyuan Zhu [ 15/Nov/15 ]

I mean... why there should be an extra "b" after those numbers? It works without them in vanilla client.

Comment by KyleD1986 [ 15/Nov/15 ]

Probably because you need to give it the correct arguments, but hey its solved that's the main thing.
Do you want to set this ticket to closed now then.

Comment by Weiyuan Zhu [ 15/Nov/15 ]

wow!it works! but why?

Comment by KyleD1986 [ 13/Nov/15 ]

Try this see if it works.

/testforblock ~ ~ ~ minecraft:hopper 0 {Items:[

{id:minecraft:bed,Count:1b,Slot:0b}

]}

Comment by SpigotMC [ 08/Nov/15 ]

Your build is not the latest and therefore may be the reason you are having this issue. Spigot is 1 version(s) behind. CraftBukkit is 0 version(s) behind. This message was automatically generated and is not guaranteed to be a solution to your issue.

Generated at Fri Apr 11 15:30:09 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.