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

LocName overrides written book titles

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • None
    • Minecraft 1.12.2, Minecraft 17w43a, Minecraft 17w43b, Minecraft 17w45a, Minecraft 17w45b, Minecraft 17w46a, Minecraft 17w47a, Minecraft 17w48a, Minecraft 17w49a, Minecraft 17w49b
    • Confirmed

      Written books have effectively three tags used to decide their name.
      1. Name
      2. LocName
      3. title

      title is set when the book is signed. Name is set when it's renamed in an anvil, and overrides title visually. If the name is later removed, title reappears. Using two tags here makes sense so as to avoid the book ever reverting to "Written Book."

      LocName is a very low-priority tag. It overrides the default item name translation and substitutes a new one. It is used to translate explorer maps while keeping the same map ID, but can be put on any item. If an explorer map is renamed, then un-renamed, the LocName translation reappears. Using two tags here makes sense so as to avoid the map ever reverting to "Map."

      So we can see that the "hierarchy" for deciding what to show on the item should be as follows, with (1) being top priority:
      1. Name
      2. title
      3. LocName translation
      4. default item translation

      However, when a written book with a title is given a LocName translation string, the LocName string appears. Since LocName corresponds to changing the "default" (from "Written Book" to something else), and books ought never to have their default name show, it stands to reason that the title should appear instead, but it does not.

      Here is an example command illustrating this behavior:

      /give @p written_book{title:"This should appear",author:"tryashtar",display:{LocName:"This should not appear"}}
      

            Unassigned Unassigned
            tryashtar [Mod] tryashtar
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              CHK: