2

I'm trying to use a command for a map I am creating and I need to test for if an armorstand by the name of Skeletor is wearing a golden helemet on its head. Here's the command I've been using:

/testfor @e[name=Skeletor,Inventory=[{Slot:103,id:golden_helemet}] 

but its says:

The entity UUID provided is in an invalid format.

2 Answers 2

1

The error you are getting simply means that no entity can be found that matches your target selector. Basically, the target selector then returns NULL, which is not a valid UUID, hence the message.

As to why your command fails, you have confused target selector arguments with data tags, which represent NBT data. While some target selector arguments duplicate checking for NBT data, for example [name=Bob] <-> {CustomName:Bob}, these are different things. In particular, some commands are unable to check NBT data altogether, such as execute (scoreboard does, and is therefore a common very workaround to turn NBT into a target selector).

Luckily, testfor is able to check matching NBT data as an optional argument:

testfor <player> [dataTag]

There is another issue with your command, which is that the Inventory data tag is only valid for players. Mobs have an Equipment tag instead, which is a list of 5 Item tags (Hand, Feet, Legs, Chest, Head). Due to Minecraft's partial tag matching, you can leave the other 4 tags empty:

In order to make your command work, you should use

/testfor @e[name=Skeletor] {Equipment:[{},{},{},{},{id:minecraft:golden_helmet}]}

For reasons unknown to me, you need to use the full item id, including the minecraft: prefix. Using only id:golden_helmet does not work.

2
  • Wait now it doesn't work. It says Skeletor does not have required data structure, and now it says unknown command. I'm using the command you gave me and it worked fine a few days ago, what am I doing wrong? Commented Jul 25, 2015 at 0:37
  • Now it works. Don't know what happened there. Sorry to bother you. Commented Jul 25, 2015 at 0:46
0

The Inventory tag doesn't work on armor stands, but the Equipment tag does.

/testfor @e[name=Skeletor] {Equipment:[{id:"",Count:,tag:{}...},{id:,Count:...},{id:...},{id:},{id:}]}.

The five arguments come in this order: Held Item, Boots, Pants, Chestplate, Helmet. You want to test for boots, so I would try this command:

/testfor @e[name=Skeletor] {Equipment:[{},{},{},{},{id:golden_helmet}]}

6
  • Sorry, I corrected the spelling but it isn't working. I double checked everything but I am playing in Minecraft 1.8.4. Does that have anything to do with it? Commented Jul 20, 2015 at 13:50
  • @KingDarren7203, Are you still getting the same error (entity UUID invalid format)?
    – Nick B.
    Commented Jul 20, 2015 at 13:52
  • @KingDarren7203, I discovered that the Inventory tag doesn't work on armor stands. Try this instead: Equipment:[{id:"",Count:,tag:{}...},{id:,Count:...},{id:...},{id:},{id:golden_helmet}]. See this minecraft wiki article.
    – Nick B.
    Commented Jul 20, 2015 at 14:00
  • This is not at all how data tags work. They can never be checked as part of an argument selector.
    – MrLemon
    Commented Jul 20, 2015 at 14:12
  • @MrLemon, Sorry, I keep forgetting that. Will edit.
    – Nick B.
    Commented Jul 20, 2015 at 14:19

You must log in to answer this question.

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