Minecraft Commands – Why is Armor Stand Name Not Detected by /testfor?

minecraft-commandsminecraft-java-edition

So, I have this command that spawns an armor stand (which should have an name of player):

summon armor_stand ~ ~1 ~ {ArmorItems:[{id:"minecraft:leather_boots",Count:1b,tag:{display:{color:4673362}},Damage:0s},{id:"minecraft:leather_leggings",Count:1b,tag:{display:{color:3949738}},Damage:0s},{id:"minecraft:leather_chestplate",Count:1b,tag:{display:{color:3847130}},Damage:0s},{id:"minecraft:skull",Count:1b,Damage:3s}],ShowArms:true,NoBasePlate:1b,name:player}

But when I spawn it I do this command:

 /testfor @e[type=Armor_Stand,name=player] {}

And it says it does not find anything. Anyone got an idea what's wrong?

Oh, and

 /testfor @e[type=Armor_Stand] {name:"player"}

didn't work too

Best Answer

Your problem isn't that it won't detect the name, but that the armor stand doesn't have the name. Use {CustomName:"player"} instead of {name:player} when summoning the armor stand and your problem should be fixed.