Minecraft Blogs / Tutorial

Showing hover event items in Written Books (Bundles with items in them)

  • 306 views, 3 today
  • 4
  • 3
imalittlhigh avatar imalittlhigh
Level 50 : Grandmaster Sweetheart
50
Since I have not found any working tutorials or hints on how to actually format for this here goes my take:

If you want to make something like this:

Showing hover event items in Written Books (Bundles with items in them)

here is the give command:

give @p written_book{display:{Name:'{"text":"test"}'},title:"",author:"",pages:['{"text":"Recipe 1","hoverEvent":{"action":"show_item","contents":{"id":"bundle","Count":1,"tag":"{Items:[{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:hopper_minecart\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:hopper\\",Count:2b},{id:\\"minecraft:lava_bucket\\",Count:1b},{id:\\"minecraft:hopper\\",Count:2b},{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:hopper_minecart\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b}]}"}}}']} 1

I cant really explain all the formatting but this is how its supposed to be ^^

here is just the part you put in the "contents" section:

{"id":"bundle","Count":1,"tag":"{Items:[{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:hopper_minecart\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:hopper\\",Count:2b},{id:\\"minecraft:lava_bucket\\",Count:1b},{id:\\"minecraft:hopper\\",Count:2b},{id:\\"minecraft:black_stained_glass_pane\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b},{id:\\"minecraft:hopper_minecart\\",Count:1b},{id:\\"minecraft:furnace\\",Count:2b}]}"}}


I have tried using mcstacker for this but they just escape everything way too much:

give @p written_book{display:{Name:'{"text":"test"}'},title:"",author:"",pages:['{"text":"Recipe 1","hoverEvent":{"action":"show_item","contents":" {\\"id\\":\\"bundle\\",\\"Count\\":1,\\"tag\\":\\"{Items:[{id:\\\\\\\\\\"minecraft:black_stained_glass_pane\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:furnace\\\\\\\\\\",Count:2b},{id:\\\\\\\\\\"minecraft:hopper_minecart\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:furnace\\\\\\\\\\",Count:2b},{id:\\\\\\\\\\"minecraft:black_stained_glass_pane\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:hopper\\\\\\\\\\",Count:2b},{id:\\\\\\\\\\"minecraft:lava_bucket\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:hopper\\\\\\\\\\",Count:2b},{id:\\\\\\\\\\"minecraft:black_stained_glass_pane\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:furnace\\\\\\\\\\",Count:2b},{id:\\\\\\\\\\"minecraft:hopper_minecart\\\\\\\\\\",Count:1b},{id:\\\\\\\\\\"minecraft:furnace\\\\\\\\\\",Count:2b}]}\\"}}"}}']} 1

Im guessing thats a bit outdated ^^

If youre making long book your best bet would probably be to but a dummy text in the "hoverEvent" field and replace that later in a text editor with your own edited component.


Here is a hover event just showing stone:

give @p written_book{display:{Name:'{"text":"test"}'},title:"",author:"",pages:['{"text":"Recipe 1","hoverEvent":{"action":"show_item","contents":{"id":"stone","Count":1}}}']} 1


Here is the command for an item with name and colour:

give @p written_book{display:{Name:'{"text":"test"}'},title:"",author:"",pages:['{"text":"Recipe 1","hoverEvent":{"action":"show_item","contents":{"id":"bundle","Count":1,"tag":"{display:{Name:\'{\\"text\\":\\"Name\\",\\"italic\\": false,\\"color\\":\\"gold\\"}\'},Items:[{id:\\"minecraft:black_stained_glass_pane\\"}]}"}}}']} 1


You can of course just display normal items.
I havent really played with other tags but the idea should be the same.
If youre in doubt just try escaping quotes or adding and removing them =)
Tags

Create an account or sign in to comment.

Planet Minecraft

Website

© 2010 - 2023
www.planetminecraft.com

Welcome