When I do a command like
/tellraw @a {text:"Pigs: ",extra:[{selector:"@e[type=Pig]"}]
}
if there are no pigs the command fails with an error message
An unknown error occurred while attempting to perform this command
rather than just displaying
Pigs:
Comments 9
I know that, but why should a pig be a player??
With "more specific" I meant, more specific about what I should do not adding some explanation of things I already know! Your comment sounds like you think there is no bug, so you should be able to explain to me what I do wrong, why it is wrong and how exactly I should archive what I want to do, otherwise think about what you want to tell me before you tell nonsense (because this sounds like it makes no sense, hence my "What??")
The selector in tellraw is only used for printing player names, and not entity names.
EXAMPLE:
/tellraw @a {selector:"@a[team=TeamRed]"}
Of course can you a have a selectror @e , but you cannot mix the targets.
---> You tried to target the tellraw command to @a but the selector was @e[type=pigs] or with other words: The @a does not contain @e[type=pigs]-
Edit: Well, I was absolutely wrong.
I believe you missed the point of my bug report, the command only fails if there are no pigs in the world, otherwise it tells all the players a list of all the pigs without a problem. But why should the whole command fail rather than just displaying the message with no players?
Just to help you out: the "@e[type=Pig]" selector in my command is not a target but part of the contents of the tellraw command! It needn't be a subset of the target or something like that.
Use @a intead of @e.