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

Written Book JSON reforming

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Awaiting Response
    • None
    • Minecraft 1.9.2
    • None
    • Java Version: 1.8.0_77
      Windows 10
      Running off a local host server
    • Unconfirmed

      Hello everyone!

      I'm making a map that requires some pretty unique command block stuff. (Fancy books that run commands and allow for baking up your save in game. Pretty legit stuff.) Well anyways, I've been experimenting with self-updating books. For the last few days I've been incredibly confused as to why the book wouldn't be cleared from my inventory. (Yes I know replace item exists.) The book would only be cleared from the inventory if it was never opened. After doing some exploring, I found out it was because of the "resolved:1b" tag that checks to see if the book needs updating. As per MC-66780 While this is very useful in theory it creates an unexpected (I hope) issue.

      When the game updates the JSON for the book when resolved's value increases from 0 to 1, it causes any JSON in the book to rearrange to a predetermined format.

      Book NBT tag (extracted using NBTExplorer) given without being read (or with a resolved:1 tag to start):

       ["",{"text":"  ⣿⠛⠃⠀⣿⡇⣠⡾⠋⠀⢸⣿⠀⠀⢸⣿⠀⠀⠀⠀⠀⣠⡾⠟⠃⠀⣠⡾⠛⢷⣄ \n","color":"dark_aqua"},{"text":"  ⠻⣷⡄⠀⣿⣿⡁⠀⠀⠀⠀⠙⢷⣴⠟⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⣿⡁⠀⢈⣿\n","color":"dark_green"},{"text":"  ⣤⣼⡇⠀⣿⡇⠙⢷⣄⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠻⣿⣶⡄⠀⠙⢷⣤⡾⠋\n","color":"gray"},{"text":"    [Trial Version]","color":"dark_red"}] 

      Book NBT tag (extracted using NBTExplorer) after game updates resolve tag to 1:

       {"extra":[{"color":"dark_aqua","text":"  ⣿⠛⠃⠀⣿⡇⣠⡾⠋⠀⢸⣿⠀⠀⢸⣿⠀⠀⠀⠀⠀⣠⡾⠟⠃⠀⣠⡾⠛⢷⣄ \n"},{"color":"dark_green","text":"  ⠻⣷⡄⠀⣿⣿⡁⠀⠀⠀⠀⠙⢷⣴⠟⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⣿⡁⠀⢈⣿\n"},{"color":"gray","text":"  ⣤⣼⡇⠀⣿⡇⠙⢷⣄⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠻⣿⣶⡄⠀⠙⢷⣤⡾⠋\n"},{"color":"dark_red","text":"    [Trial Version]"}],"text":""} 

      I am currently running off of a server as I have people helping me make the map, and I don't know of how to force-crash debug information on console interface.

      Commands used for examples:

      Book without tag:

       /give @a[score_bookVersion_min=0,score_bookVersion=0] written_book 1 0 {pages:["[\"\",{\"text\":\"  ⣿⠛⠃⠀⣿⡇⣠⡾⠋⠀⢸⣿⠀⠀⢸⣿⠀⠀⠀⠀⠀⣠⡾⠟⠃⠀⣠⡾⠛⢷⣄ \n\",\"color\":\"dark_aqua\"},{\"text\":\"  ⠻⣷⡄⠀⣿⣿⡁⠀⠀⠀⠀⠙⢷⣴⠟⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⣿⡁⠀⢈⣿\n\",\"color\":\"dark_green\"},{\"text\":\"  ⣤⣼⡇⠀⣿⡇⠙⢷⣄⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠻⣿⣶⡄⠀⠙⢷⣤⡾⠋\n\",\"color\":\"gray\"},{\"text\":\"    [Trial Version]\",\"color\":\"dark_red\"}]","[\"\",{\"text\":\"[Skyco Desk]\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger skyco set 1\"}}]"],title:Skyco Pedia,author:Skyco} 

      Book with tag:

       /give @a written_book 1 0 {pages:["[\"\",{\"text\":\"  ⣿⠛⠃⠀⣿⡇⣠⡾⠋⠀⢸⣿⠀⠀⢸⣿⠀⠀⠀⠀⠀⣠⡾⠟⠃⠀⣠⡾⠛⢷⣄ \n\",\"color\":\"dark_aqua\"},{\"text\":\"  ⠻⣷⡄⠀⣿⣿⡁⠀⠀⠀⠀⠙⢷⣴⠟⠀⠀⠀⠀⠀⢸⣇⠀⠀⠀⠀⣿⡁⠀⢈⣿\n\",\"color\":\"dark_green\"},{\"text\":\"  ⣤⣼⡇⠀⣿⡇⠙⢷⣄⠀⠀⠀⢸⣿⠀⠀⠀⠀⠀⠀⠀⠻⣿⣶⡄⠀⠙⢷⣤⡾⠋\n\",\"color\":\"gray\"},{\"text\":\"    [Trial Version]\",\"color\":\"dark_red\"}]","[\"\",{\"text\":\"[Skyco Desk]\",\"color\":\"dark_green\",\"clickEvent\":{\"action\":\"run_command\",\"value\":\"/trigger skyco set 1\"}}]"],title:Skyco Pedia,author:Skyco,resolved:1b} 

      Edit:
      Now, this can be solved by following the updated format, but it's not exactly easy as a few parts of the information aren't shown. As well, minecraftjson.com is pretty much my life blood when making long books.

      Edit2: In case it isn't clear, my intention is to create a book "version 1" then, after the user interact with it, erase it and replace it with version two. However, due to the mechanics of updating JSON syntax changing when the 1B tag updates, I am unable to delete the book.

            Unassigned Unassigned
            Miss_Potatoes Trish Goodman
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: