mojira.dev
MC-55253

The new {selector:"@..."} tellraw feature fails on failing selectors!

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

What??
Please be more specific!

@e is entities.

@a and @p are for players.

Use either @a and @p intstead of @e.

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.

I'll take a look at it next week.

This should already be fixed in the most recent snapshots

Frank Steffahn

michael

Unconfirmed

Minecraft 14w20b

Minecraft 14w30c, Minecraft 14w31a

Retrieved