How to use testfor with a mob with a two-word name?

How can I test for mob who has a name with two words? For example villager named Grumpy Bill. For example I want to kill this villager.
This command
/kill @e[name=Bill]
would work just fine but when I try
/kill @e[name=Grumpy Bill]
it says "The entity UUID provided is in an invalid format"
What is the proper command for this action?
Best Answer
Use the NBT Tag "CustomName", and to make it for /kill use: /scoreboard objectives add KillSpacedName dummy KillSpacedName /scoreboard players set @e KillSpacedName 1 {CustomName:Grumpy Bill} /kill @e[score_KillSpacedName_min=1]
Pictures about "How to use testfor with a mob with a two-word name?"



How do you Testfor entities in Minecraft?
2. Type the CommandHow to detect mobs with custom names near a player?
More answers regarding how to use testfor with a mob with a two-word name?
Answer 2
I've learned that you cannot have a space between the words of the name, such as Do not touch
.
Instead you will need to fill those spaces with underscores. For example, Do_not_touch
.
Answer 3
In commands, you can't have spaces. Use the underscore. Something like
Grumpy_Bill
Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.
Images: Ryutaro Tsukata, Ryutaro Tsukata, Andrea Piacquadio, Andrea Piacquadio