mojira.dev
MC-55333

"selector" Tag Not Usable in "translate" Arguments for /tellraw and /title

The following translatable text will be used:

achievement.openInventory.desc = Press '%1$s' to open your inventory.

To insert text in place of the argument (%1$s), the "with" list-tag must be used. For example, a working command:

/tellraw @a {
	translate:"achievement.openInventory.desc",
	with:[
		{
			text:"TEST",
			color:gold
		}
	]
}

Result: "Press 'TEST' to open your inventory."

However, using the new "selector" tag will not provide the player's name, and instead displays the selector itself:

/tellraw @a {
	translate:"achievement.openInventory.desc",
	with:[
		{
			selector:"@p",
			color:gold
		}
	]
}

Result: "Press '@p' to open your inventory."

Changing the "with" to "extra" will properly display the player's name at the end of the text, showing that the selector works correctly elsewhere:

/tellraw @a {
	translate:"achievement.openInventory.desc",
	extra:[
		{
			selector:"@p",
			color:gold
		}
	]
}

Result: "Press '' to open your inventory.Skylinerw"

Linked issues

Attachments

Comments 4

According to http://minecraft.gamepedia.com/Tellraw#Raw_JSON_Text "selector" cannot be nested in "with".
"text", "translate" and "selector" are mutually exclusive.

The wiki is referring to using "text", "score", "translate", and "selector" at the same time, in which they all are attempting to create the root text to display. This is unrelated to embedding a player name within the translation arguments. You can already use "translate" and "score" within the arguments, so "selector" should be expected to follow suit.

There is a separate bug concerning the "score" tag. Though it does not concern the "selector" tag directly, it may be somewhat related: MC-50176

Note to self: The Wiki is not an authoratiative source

The one with "selector" seems to be fixed in 14w21b

*Added screenshot (The sentence is pretty sweet 🙂 )

Skylinerw

(Unassigned)

Unconfirmed

Minecraft 14w20b

Minecraft 14w21b

Retrieved