Minecraft Blogs / Tutorial

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

  • 1,249 views, 2 today
  • 13
  • 8
  • 3
imalittlhigh's Avatar imalittlhigh
Level 61 : High Grandmaster Sweetheart
109
Since I have not found any working tutorials or documentation 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 put 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

1 Update Logs

Update #1 : by imalittlhigh 04/05/2023 7:15:41 amApr 5th, 2023

fixed typos

Create an account or sign in to comment.

1
04/05/2023 7:31 am
Level 56 : Grandmaster Scapegoat
Papa Enny
Papa Enny's Avatar
wow
2
04/04/2023 10:47 pm
Level 55 : Grandmaster Architect
Zwil
Zwil's Avatar
Wow! Someone actually made a guide for this. I have looked for years on how to use this feature, but no one seems to know anything about it.



The ID bundle, where and how do you find this kind of stuff?
3
04/05/2023 7:13 am
Level 61 : High Grandmaster Sweetheart
imalittlhigh
imalittlhigh's Avatar
Do you mean this: "action":"show_item","contents":{"id":"bundle","Count":1,"tag" ?

Thats just the id that is displayed if you have f3+h on. "minecraft:bundle" would technically be better to use here.

And technically there is documentation on how to use this on the mc wiki, its just very surface level and you have the experiment a lot for it to work ^^

If that wasnt your question feel free to add me on disc and ask there. imalittlhigh#3104
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome