Minecraft – What typo am I making? (/testfor)

minecraft-commandsminecraft-java-edition

I have a command block connected to a hopper clock that checks for a named Ender Pearl like so:

/testfor BrokenRobot_ {Inventory:[{id:"ender_pearl",Unbreakable:1,Damage:0,Count:1,Slot:9,tag:{display:{Name:"Name"}}}]}

When I /give myself the same item with the same NBT data, and put it in the top-left inventory slot (I'm pretty sure that's slot nine…) it says:

The entity UUID provided is in an invalid format

So what am I doing wrong?

Best Answer

The entity UUID provided is in an invalid format

Usually means that the game can't resolve an entity matching the target selector and data tag specified. I.e. NULL is not a valid UUID.

There are three issues with your command:

  1. You are missing the "minecraft:" in front of "ender_pearl", in NBT data the "minecraft:" is not optional, unlike in commands.
  2. The unbreakable tag should not exist on an inventory item that does not have durability.
  3. Your values are missing the type indicator ("b" for byte, "s" for short, etc.), while this is often not an issue, some values do break if you don't use them.

The command I used is:

/testfor @p {Inventory:[{Count:1b,Slot:9b,Damage:0s,id:minecraft:ender_pearl,tag:{display:{Name:Name}}}]}