mojira.dev
MC-111526

in written books the hover event display item just displays invalid item

whenever i give the player a written book that is supossed to have the hover event show item it just displays invalid item in red text

Comments 4

Please attach the command used.

here is command:
/give @p minecraft:written_book 1 0 {title:"test",author:"",generation:0,pages:["{text:\"dirt\",color:black,bold:true,hoverEvent:{action:'show_item',value:\"minecraft:dirt 1 0\"}}"]}

(Can't test myself atm)

Please try the following:

give @p minecraft:written_book 1 0 {title:"test",author:"santa",generation:0,pages:["[\"\",{\"text\":\"dirt\",\"color\":\"black\",\"bold\":\"true\",hoverEvent:{\"action\":\"show_item\",\"value\":\"minecraft:dirt 1 0\"}}]"]}

or

give @p minecraft:written_book 1 0 {title:"test",author:"santa",generation:0,pages:["{\"text\":\"dirt\",\"color\":\"black\",\"bold\":\"true\",hoverEvent:{\"action\":\"show_item\",\"value\":\"minecraft:dirt 1 0\"}}"]}

The show_item event takes raw NBT input for an item, not a broken-up /give command:

give @p minecraft:written_book 1 0 {title:"test",author:"santa",generation:0,pages:["[\"\",{\"text\":\"dirt\",\"color\":\"black\",\"bold\":\"true\",hoverEvent:{\"action\":\"show_item\",\"value\":\"{id:\\\"minecraft:dirt\\\",Count:1b}\"}}]"]}

tristan poole

(Unassigned)

Unconfirmed

Minecraft 1.11, Minecraft 16w50a

Retrieved