Links to webpages in books

In multiple multiplayer servers I play in (e.g. Hypixel), There are books with text in them, and when you click on the text it takes you to a website.

How do I replicate this?

Hypixel Daily Reward Book with link

Answer

You can use clickEvent with open_url:

/give @s minecraft:written_book{pages:["[\"\",{\"text\":\"Arqade\",\"color\":\"gray\",\"underlined\":true,\"clickEvent\":{\"action\":\"open_url\",\"value\":\"https://gaming.stackexchange.com/\"}}]"],title:"foo",author:"bar"}

book

url opened

Attribution
Source : Link , Question Author : 65_7a , Answer Author : L. F.

Leave a Comment