mojira.dev
MC-51226

/testfor /clear /testforblock don't work correctly with TAG_LIST with TAG_COMPOUND inside NBT Tag

---------------------- Example 1 (/Clear )------------------------------
1. Type this command to give you a diamond sword with nbt tag

/give @p minecraft:diamond_sword 1 0 {ench:[{id:16,lvl:3}]}

2.Type this command to check for the diamond sword

/clear @p minecraft:diamond_sword 0 0 {ench:[{id:16,lvl:3}]}

3.Notice that it found your diamond sword

4.clear that diamond sword
5. Type this command to give you a normal diamond sword

/give @p minecraft:diamond_sword

6. enchant it with this command

/enchant @p 16 3

7.Type this command to check for the diamond sword ( same as Step 2)

(I think it should found the diamond sword because it has the same nbt tag)

/clear @p minecraft:diamond_sword 0 0 {ench:[{id:16,lvl:3}]}

8.Notice that it didn't find your diamond sword

------------------ Example 2 (testforblock) --------------------------------------
1.place a chest
2.put an item in first slot (this example will use diamond sword)
3.type this command (Change x y z to coordinates)

/testforblock <x> <y> <z> minecraft:chest {Items:[{id:minecraft:diamond_sword}]}

4.Notice that it found the chest

5.type this command (Change x y z to coordinates)

/testforblock <x> <y> <z> minecraft:chest {Items:[{id:minecraft:diamond_sword,Slot:0}]}

6.Notice that it didn't find the chest

Linked issues

Attachments

Comments 4

You need to specify the tag type.

Slot:0b, id:16s,lvl:3s

Rodchananat

(Unassigned)

Unconfirmed

Minecraft 14w11b

Retrieved