How do you check for a custom banner?

How do you check for a custom banner? - Set of gratitude message for doctors with stethoscope and hearts

I want to have a command block that checks if your holding a banner with an arrow on it, can someone help? Thanks!



Best Answer

To check for an item in the players hand:

/testfor @p[r=10] {SelectedItem:{id:"minecraft:diamond_sword"}}

Or if you want to check the players entire inventory:

/testfor @p[r=10] {Inventory:[{id:"minecraft:diamond_sword"}]}

To specifically target a type of banner you need to know the exact pattern of the banner, then you can use this structure to find it:

/testfor @p[r=10] {Inventory:[{
    id:"minecraft:banner",
    tag:{BlockEntityTag:
        {Base:15,
        Patterns:[
            {Pattern:mc,Color:4},
            {Pattern:flo,Color:15},
            {Pattern:tt,Color:4}
        ]}
    }}
]}

To break this command down, once you've selected the banner item, you need to know the banners base colour (in this example 15) then you match each pattern on the banner inside the pattern array.

Each pattern looks like this {Pattern:mc,Color:4} including the the pattern and the colour. Stack these commands up so they exactly describe your banner, and it should correctly check if the player tested is carrying it.

Command as you would use it (edited to match your banner of course) would look like this:

/testfor @p[r=10] {Inventory:[{id:"minecraft:banner",tag:{BlockEntityTag:{Base:15,Patterns:[{Pattern:mc,Color:4},{Pattern:flo,Color:15},{Pattern:tt,Color:4}]}}}]}

Some good resources:

http://www.minecraftforum.net/forums/minecraft-discussion/recent-updates-and-snapshots/2179208-testfor-custom-banner-on-a-players-head




Pictures about "How do you check for a custom banner?"

How do you check for a custom banner? - Crop technician checking contacts on motherboard in workshop
How do you check for a custom banner? - Faceless female seller with notepad near clothes on hangers
How do you check for a custom banner? - Crop anonymous female customer in protective mask reading label on frozen food in plastic container in grocery store



How do you get custom banners in Minecraft?

Banner patterns can be created with a piece of paper and a specific item such as a creeper head. Once the banner pattern is created, put it in the bottom slot in the loom. Put the banner in the left loom slot, and the chosen dye in the right loom slot. This will make a custom banner.

How much does it cost to get a banner?

A standard pricing rule of thumb for local sign shops is to charge $8 per square foot for printed banners. So, a 6' x 3' banner would cost approximately $144\u2014but keep in mind that this price only includes the banner material, labor, and printing.

How do you get a banner pattern on Mojang?

Add Items to make the Thing Banner Pattern In the crafting menu, you should see a crafting area that is made up of a 3x3 crafting grid. To make the Thing banner pattern, place 1 paper and 1 enchanted golden apple in the 3x3 crafting grid.



Custom Banner From Amazon Review and Quality Check




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Karolina Grabowska, RF._.studio, Liza Summer, Laura James