mojira.dev
MC-54941

name= selector does not function with names containing symbols or spaces

I grabbed 2 chicken spawn eggs and named 1. bosschicken & 2. boss chicken

I then made 2 command blocks to do a testfor those named entities and it only picked up the name: bosshchicken.

e.g. are shown in pic's

Linked issues

Attachments

Comments 16

Incorrect. Cave Spider, Magma Cube, Iron Golem, Zombie Pigman .. all of their base names have spaces in them, as also shown when you highlight those particular spawn eggs

Dosent work if you use that as there is no such thing, the command block wont even error due to the fact it dosent exist.

do @e[name="boss chicken"]

the issue here is, blah mistakenly thought that you meant type instead of name. for example, the 'name' of your chicken is boss chicken, but the 'type' is still chicken. add quotes and it will work fine.

Unf using " marks dosent work either, it gives same error as before without using " marks

You can create a custom UUID to work around this

6 more comments

The issue for myself was the fact that trying to use existing mob names, such as iron golem, pig zombie cant be done since they contain spaces

set up a dummy score board objective that uses CustomName.
Example:
scoreboard objectives add Name dummy
scoreboard players set @p Name 1 {CustomeName:Bob Bob}
testfor @e[score_Name=1,score_Name_min=1]

This method works for many different aspects other than just the name of an entity.
It seems like this might have been added as a work around to issues like this one.

well this stinks. I was going to make a new report for this but i guess this is my issue as well. For more examples here is what i was doing to get this issue.

So i want to summon Armor Stand to use as titles,
"/summon ArmorStand ~ ~ ~ {Invisible:1b,CustomNameVisible:1,CustomName:"New Changes"}"

but when i want to move it or change it, i will use /kill,
"/kill @e[name=New Changes]" (adding quotes around the spaced phrase doesn't work either)

That sadly doesn't work so i have to use,
"/kill @e[type=ArmorStand,r=1]"

Which works for now/ my situation. My question would be is what is causing it to not show up as a UUID? because of the space? how would i get the proper id if i wanted to know it?

Still effects latest snapshot, 15w31b. sadly.

Any chance that entity selectors can contain spaces any time soon or is this still place dinto the FAR future version?

Handling of spaces in selectors won't change any time soon. In 1.9 (and current snapshots) using tags on entities is the best alternative to using the name.

Warren Liddell

michael

Unconfirmed

selector

Minecraft 14w19a, Minecraft 14w20a, Minecraft 14w20b, Minecraft 14w21a, Minecraft 14w21b, Minecraft 14w25a, Minecraft 14w25b, Minecraft 14w26c, Minecraft 14w27b, Minecraft 15w31c

Retrieved