Updated:

A rule book by version

VersionCommand
Java 1.21.5+/give @p minecraft:written_book[written_book_content={title:"Server Rules",author:"Admin",pages:["1. Do not grief","2. Ask an admin for help"]}]
Java 1.20.5–1.21.4/give @p minecraft:written_book[written_book_content={title:"Server Rules",author:"Admin",pages:['"1. Do not grief"','"2. Ask an admin for help"']}]
Java 1.20.4 and earlier/give @p minecraft:written_book{title:"Server Rules",author:"Admin",pages:['{"text":"1. Do not grief"}','{"text":"2. Ask an admin for help"}']}

Each entry in pages is one page. From 1.21.5 a page can be a plain string; before that every page is JSON text inside single quotes. Mixing the two gives an error or an empty book. Keep the title to 32 characters.

Colors and bold text

# Java 1.21.5+
/give @p minecraft:written_book[written_book_content={title:"News",author:"Admin",pages:[{text:"Event today!",color:"gold",bold:true}]}]
# Java 1.20.5–1.21.4
/give @p minecraft:written_book[written_book_content={title:"News",author:"Admin",pages:['{"text":"Event today!","color":"gold","bold":true}']}]

Color names are the same as for item names. To use several colors on one page, write a list: [{text:"Red ",color:"red"},{text:"Blue",color:"blue"}].

Clickable pages

# Java 1.21.5+
/give @p minecraft:written_book[written_book_content={title:"Menu",author:"Admin",pages:[{text:"[Back to spawn]",color:"aqua",click_event:{action:"run_command",command:"/trigger lobby"}}]}]
# Java 1.21.4 and earlier (the click part)
{"text":"[Back to spawn]","clickEvent":{"action":"run_command","value":"/trigger lobby"}}

Clicking runs the command as the reader. Players without operator rights cannot run /tp and similar commands, so books for everyone should use /trigger. In 1.21.5 clickEvent became click_event and value became command.

To jump to another page, use click_event:{action:"change_page",page:3} (before 1.21.5: "clickEvent":{"action":"change_page","value":"3"}). This is handy for a table of contents.

A book players can still write in

# Java 1.20.5+
/give @p minecraft:writable_book[writable_book_content={pages:["Write your feedback here"]}]

A book and quill with starting text can still be edited and signed by the player, which works well for feedback forms or shared diaries.

Bedrock Edition

Bedrock's /give cannot set book contents. Write and sign the book in game, or store a chest of finished books with /structure and load it where you need copies.

Common problems

Common questions

Check your command

The Command Error Doctor checks common syntax mistakes in your browser.