Minecraft – Test for Armor stand with certain armor

minecraft-commandsminecraft-java-edition

I want to make a command that tests for an armor stand that has a pumpkin on the head and wears a leather chestplate, leggings and boots but I can't find the right inventory slots. How can I do this?

Here is the very basic command that I am trying to use:

/testfor @e[type=Armor_Stand] {SelectedItemSlot:0-8,Inventory:[{Slot:0-8b,tag:{display:{Name:"Example"}}}]}

Best Answer

You'll want to use this:

/testfor @e[type=ArmorStand] {Equipment:[{id:hand item},{id:boots},{id:pants},{id:chest},{id:helmet}]}

If you don't want to test for a certain slot just leave the { } of that slot empty.
Like Equipment:[{},{id:boots},{id:pants},{id:chest},{id:helmet}] for testing only for armor and no hand item.

Related Topic