I'd like to detect a banner of a specific color in various situations: Standing, hanging, dropped, and inside player/entity inventory (as well as in the head slot).
These work:
/testfor @e[type=Item] {Item:{id:"minecraft:banner"}}
/testfor @a {Inventory:[{id:"minecraft:banner"}]}
These don't work:
/testfor @e[type=Item] {Item:{id:"minecraft:banner",Damage:0}}
/testfor @e[type=Item] {Item:{id:"minecraft:banner",Base:0}}
/testfor @e[type=Item] {Item:{id:"minecraft:banner"},Damage:0}
/testfor @e[type=Item] {Item:{id:"minecraft:banner"},Base:0}
/testfor @e[type=Item] {Item:{id:"minecraft:banner",tag:{Damage:0}}}
/testfor @e[type=Item] {Item:{id:"minecraft:banner",tag:{Base:0}}}
Any ideas?
Best Answer
I have read the entire internet and discovered the ways to detect banners with specific base colors. It turns out that I was really close. Here are some examples that are working in 1.8.1:
Test for a placed banner (on the ground) that is Blue colored (
{Base:4}
), and facing north (8):Test for a placed banner (hanging) that is Blue colored (
{Base:4}
), and facing north (2):Test for a banner in a player's inventory (note the
4s
means Blue. Thes
is important):Test for a banner that has been dropped on the ground that is Blue colored (
Damage:4s
):Notes:
0
being black,1
being red, etc. etc.