Create a new written book the usual way, writing in a book. Suppose the book looks like this, from my inventory:
{components: {"minecraft:written_book_content": {pages: [{text: '"Hi"'}], author: "BlueMeanial", title: {text: "Fred"}, resolved: 1b}}, count: 1, Slot: 0b, id: "minecraft:written_book"}
I want to give a player a book just like this. So I say
/give @s minecraft:written_book{"minecraft:written_book_content": {pages: [{text: '"Hi"'}], author: "BlueMeanial", title: {text: "Fred"}, resolved: 1b}}
The book the user receives doesn't work. It looks like this:
{components: {"minecraft:custom_data": {"minecraft:written_book_content": {pages: [{text: '"Hi"'}], author: "BlueMeanial", title: {text: "Fred"}, resolved: 1b}}}, count: 1, Slot: 1b, id: "minecraft:written_book"}
Note the wrapping "minecraft:custom_data" node. Obviously the received book won't work.
That's the wrong syntax. Outside curly braces are now just used for custom data that you can store on an object (hence the wrapping "minecraft:custom_data" node). Item properties have been migrated to components and the syntax uses square brackets. The proper command is written the following: