mojira.dev
MC-50176

Asterisk as Name for Score Chat Component Not Effective as Translatable Argument

In the tellraw command's JSON message when * is used as the name in a score component it is not replaced when it's an argument for translatable component. It is expected to be replaced with the player's name that receives the message.

This can be recreated by doing the following:

  1. /scoreboard objectives add test dummy

  2. /scoreboard players set @p test 501

  3. /tellraw @p {translate:"commands.seed.success",with:[{score:{name:"*",objective:"test"}}]}

The * is treated as a player and if you don't have a score for * then a "?" is shown.

I encountered this bug when I was trying to insert a value into a custom translation key. Specifically:

tellraw @a[score_trading_min=1] 
{
  translate:"trading.offer.oneItem",
  with:[
    {
      translate:"resources.wheatAmount",
      with:[
        {
          score:{
            name:"*",
            objective:"wheatOffer"
          }        
        }
      ],
      color:"yellow"
    }
  ],
  color:"gray"
}

After this predicament I decided to check out the code and make a mod to fix it. Which you can download for yourself here (14w10c). Installation Intructions

Linked issues

Comments 2

Can confirm in 14w20b.

This should already be fixed in the most recent snapshots

Paul Fulham

michael

Unconfirmed

Minecraft 14w07a, Minecraft 14w08a, Minecraft 14w10b, Minecraft 14w10c, Minecraft 14w11b, ..., Minecraft 14w18b, Minecraft 14w19a, Minecraft 14w20b, Minecraft 14w21a, Minecraft 14w21b

Minecraft 14w30c, Minecraft 14w31a

Retrieved