(Not sure what versions this supports, but I'm on 1.8.1-pre4)
As far as I know, the only way to detect if any player has a banner of a certain color is:
/clear @a banner 4 0
The above is limited in that it will only tell you yes or no (via comparator). It won't allow you to do anything to the person. (4 is "blue", 0 means "don't really clear the item")
Note: I've been attempting to figure out how to check the color of the banner in the inventory. The NBT explorer results are confusing (See attached image). It appears that the "Base" or canvas color of the flag is stored in the "Damage" field, but I have NOT been able to successfully query this field with NBT selectors.
The Meaning of Life, the Universe, and Everything.
Join Date:
10/6/2013
Posts:
255
Minecraft:
setzke
Xbox:
setzke
Member Details
There's a chance you may have to use the tag:[] tag, but I am not sure. If the banner is mandatorily going to be on someone's head... I don't foresee anyone other than the flag carrier having one on their head, right? So would just testing for a banner on the head slot work?
/replaceitem entity @p slot.armor.head minecraft:banner 1 0 {BlockEntityTag:{Base:15,Patterns:[{Pattern:mc,Color:4},{Pattern:flo,Color:15},{Pattern:tt,Color:4},{Pattern:cr,Color:15},{Pattern:cbo,Color:4},{Pattern:bts,Color:15}]}}
That is just an example using a banner that looks like a bunny.
Thanks!
This will tell you if any player has a banner in their head-slot:
I haven't been able to figure out how to match the base color/patterns yet.
This will allow you to mark a flag carrier:
(Not sure what versions this supports, but I'm on 1.8.1-pre4)
As far as I know, the only way to detect if any player has a banner of a certain color is:
The above is limited in that it will only tell you yes or no (via comparator). It won't allow you to do anything to the person. (4 is "blue", 0 means "don't really clear the item")
Note: I've been attempting to figure out how to check the color of the banner in the inventory. The NBT explorer results are confusing (See attached image). It appears that the "Base" or canvas color of the flag is stored in the "Damage" field, but I have NOT been able to successfully query this field with NBT selectors.
this website is so.glitchy on phones!*
I believe it would be
edit: Thanks Tonkah. Due to you work, I was able to just add on to it.
Damage is an old item data key that is used for various things depending on the item, but it usually represents the main alternate options for an item. I'm not sure what the 's' means after 4, but I discovered it from this post: http://www.minecraftforum.net/forums/minecraft-discussion/recent-updates-and-snapshots/382697-how-to-test-for-dropped-items-with-14w02c?comment=20
Edit: setzke, Thanks for figuring that out. It will be nice to be able to test for other item data as well! <3