-1

I need to know how to detect if an armour stand has a helmet on its head. By that, I mean any item, such as a player head or other item. I already tested something like :

execute as @e[type=armor_stand,nbt:{ArmorItems:[{},{},{},{id:"player_head",Count:1b}]}]

But unfortunately, this is not working. How can I make it work?

(I'm porting this to a data pack if anyone is curious)

I am in 1.16.5.

5
  • 4
    What have you tried already, and which edition of Minecraft? Mar 24, 2021 at 17:30
  • I'm not sure what you mean by "ArmorStand have helmet on head". Do you mean by them having an armorstand on their head, or a helmet on their head? Please edit your question so we can understand your question better to help you. Mar 24, 2021 at 21:24
  • Voting to close until version is stated. If you state your version and maybe even a little more info I'm sure me and others would be happy to reopen it (if/ when it does close).
    – Penguin
    Mar 25, 2021 at 2:14
  • And which version of Minecraft are you using?
    – Joachim
    Mar 25, 2021 at 8:41
  • i am using 1.16.5 version
    – Lago
    Mar 25, 2021 at 8:43

1 Answer 1

-1

Well a way to test this would be to use the replace item command, as you might already know, when a command block is executed it emits a redstone signal, so you could have a command block running to test if there is a helmet on the armor stand, you can do this by constantly replacing the armor stands helmet piece with air, and once someone puts a helmet on it, it will emit a redstone signal and then be removed. Here's the command:

/replaceitem entity <target> slot.armor.head air 1

Just make sure there is a slight delay between the time the helmet is placed and the time the helmet is removed. If you have any further questions feel free to ask me.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .