Uploaded image for project: 'Minecraft: Java Edition'
  1. Minecraft: Java Edition
  2. MC-132163

Selector with Item NBT Fails if Item Name is Stylized

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 1.13-pre4
    • None
    • Unconfirmed

      I've tried this is pre2 and pre4, fails in both.

      If I run a scoreboard command targeting players who have flint in their inventory with the Name of "TestFlint", it fails if that item has a stylized name (shown below). If I remove the color and italics, it seems to work fine. I've tried selecting by Name using the stylizing portions of the /give command as well, with no results.

      # paste into command block
      # indents shown here to help with code visibility
      # does not work
      give @p minecraft:flint{
      	display:{
      		Name:"{\"text\":\"TestFlint\",\"color\":\"blue\",\"italic\":true}"
      	}
      } 1
      
      # paste into command block
      # indents shown here to help with code visibility
      # works
      give @p minecraft:flint{
      	display:{
      		Name:"{\"text\":\"TestFlint\"}"
      	}
      } 1
      
      # look for players holding TestFlint and increment their score
      scoreboard players add @a[nbt={SelectedItem:{id:"minecraft:flint",Count:1b,tag:{display:{Name:"{\"text\":\"TestFlint\"}"}}}}] test 1
      

            Unassigned Unassigned
            daniel.scutt Daniel W Scutt
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: