JSON Inheritance in Books Differs from /tellraw, /title, and Signs
NOTE: This is not a duplicate of MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.
I have confirmed that the following fix does work using 1.8 MCP:
The reason why this happens is because the public void drawScreen(int mouseX, int mouseY, float partialTicks) method of the net.minecraft.client.gui.GuiScreenBook class calls the method String getUnformattedText() of the net.minecraft.util.IChatComponent interface which results in "§lGood bye.". However instead it should call the String getFormattedText() method which would results in "§r§r§l§lGood§r bye.§r" (the correct text).
When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\" bye.\"]"]}
Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\"\\nbye.\"]"]}
This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
Linked Issues
is duplicated by2
Created Issue:
Book JSON Inheritance in Books Differs from /tellraw, /title, and Signs
NOTE: This is unrelated to
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},' bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}
BookJSON Inheritance in Books Differs from /tellraw, /title, and Signs
NOTE: This is
unrelated toMC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},' bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},' bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}This only occurs with formatting options, including: color, bold, italic, underlined, obfuscated,
NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},' bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}This only occurs with formatting options, including: color, bold, italic, underlined, obfuscated
,NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},' bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
relates to
is duplicated by
relates to
NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'bye.']"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["['',{text:'Good',bold:true},'\nbye.']"]}This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\" bye.\"]"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\"\nbye.\"]"]}This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
relates to
Relates to
MC-83469
is duplicated by
NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.
I have confirmed that the following fix does work using 1.8 MCP:
The reason why this happens is because the public void drawScreen(int mouseX, int mouseY, float partialTicks) method of the net.minecraft.client.gui.GuiScreenBook class calls the method String getUnformattedText() of the net.minecraft.util.IChatComponent interface which results in "§lGood bye.". However instead it should call the String getFormattedText() method which would results in "§r§r§l§lGood§r bye.§r" (the correct text).
When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\" bye.\"]"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\"\nbye.\"]"]}This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
NOTE: This is not a duplicate of
MC-55373, which outlines specifics to inheritance. This report is exclusive to books, in which the outlined specifics to inheritance in the other report are not followed as they should be expected to.
I have confirmed that the following fix does work using 1.8 MCP:
The reason why this happens is because the public void drawScreen(int mouseX, int mouseY, float partialTicks) method of the net.minecraft.client.gui.GuiScreenBook class calls the method String getUnformattedText() of the net.minecraft.util.IChatComponent interface which results in "§lGood bye.". However instead it should call the String getFormattedText() method which would results in "§r§r§l§lGood§r bye.§r" (the correct text).
When using the following:
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\" bye.\"]"]}Picture "book inherit" displays the result, in which both "Good" and "bye." are bold, while only "Good" is supposed be bold. Picture "sign inherit" shows the exact same JSON being used, which displays how inheritance should be expected.
This is displayed correctly for signs, /tellraw, and /title, but not for books. If the newline character (\n) is inserted before "bye.", the inheritance occurs as it should be expected to, shown in picture "book inherit 2":
/give @a minecraft:written_book 1 0 {title:"Test",author:"Test",pages:["[\"\",{\"text\":\"Good\",\"bold\":true},\"\\nbye.\"]"]}This only occurs with formatting options, including: color, bold, italic, strikethrough, underlined, and obfuscated.
relates to



Confirmed. Does this only pertain to the bold text though?
@qmagnet: appears to only inherit formatting options. clickEvents and hoverEvents are not transferred.
So affects color as well?
Yep.
Confirmed for:
pages:[ "{ \"extra\":[ { \"bold\":true, \"text\":\"Good\" }, \" bye.\" ], \"text\":\"\" }" ]Note: The order of the elements should not matter, "Good" and " bye" should both inherit from ""
Please link to this comment in the description of the report.
The following is based on decompiled version of Minecraft 1.8 using MCP. All method and class names are the names used in the decompiled version.
The reason why this happens is because the public void drawScreen(int mouseX, int mouseY, float partialTicks) method of the net.minecraft.client.gui.GuiScreenBook class calls the method String getUnformattedText() of the net.minecraft.util.IChatComponent interface which results in "§lGood bye.". However instead it should call the String getFormattedText() method which would result in "§r§r§l§lGood§r bye.§r" (the correct text).