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
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}\"}}]"]}
Please attach the command used.