From 8e31a37ea9659f900995a84fdd696ff009405809 Mon Sep 17 00:00:00 2001 From: Anon Date: Sat, 2 May 2026 18:51:40 +0200 Subject: [PATCH] Document book command support Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- docs/guide/README.md | 2 + docs/guide/usage.md | 111 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 113 insertions(+) diff --git a/docs/guide/README.md b/docs/guide/README.md index b645b958..a5fd572d 100644 --- a/docs/guide/README.md +++ b/docs/guide/README.md @@ -71,6 +71,8 @@ It was originally made by [ORelio](https://github.com/ORelio) in 2012 on the [Mi - [Inventory Handling](usage.md#inventory) +- [Book Support](usage.md#book) + - [Terrain Traversing](usage.md#move) - Entity Handling diff --git a/docs/guide/usage.md b/docs/guide/usage.md index d6dcfaeb..6aa10b6a 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -267,6 +267,117 @@ In scripts and remote control, no slash is needed to perform the command, eg. `q +
+book + +

Note

+ +**You need to have [Inventory Handling](configuration.md#inventoryhandling) enabled in order for this to work.** + +
+ +- **Description:** + + Read the book in your main hand, or edit it if it is a writable book. + + In TUI mode, `/book read` opens a page viewer instead of printing the whole book to chat. The same viewer also opens automatically when the server tells the client to open a book. + + If you are holding a writable book, you can replace all pages, update one page, insert a page, delete a page, and sign the finished book. + +- **Usage:** + + Read the current book or a single page: + + ``` + /book read [page] + ``` + + Replace the whole writable book from inline text or a file: + + ``` + /book write text + /book write file + ``` + + Open the TUI editor or edit specific pages from the command line: + + ``` + /book edit + /book edit page + /book edit insert + /book edit delete + ``` + + Sign the writable book in your main hand: + + ``` + /book sign + ``` + +- **Notes:** + + `read` works with a writable book or a written book in your main hand. + + `write`, `edit`, and `sign` require a writable book in your main hand. + + Use `\n` for line breaks and `\f` for page breaks when passing inline text. + + MCC checks page count, page length, and title length against the current protocol before sending the packet. + + The interactive editor is only available in TUI mode. + +- **Examples:** + + Read the held book: + + ``` + /book read + ``` + + Show only page 2: + + ``` + /book read 2 + ``` + + Write two pages from the command line: + + ``` + /book write text First page\nSecond line\fSecond page + ``` + + Load the book text from a file: + + ``` + /book write file ./letter.txt + ``` + + Replace page 3: + + ``` + /book edit page 3 Updated text for page three + ``` + + Insert a new page before page 2: + + ``` + /book edit insert 2 This page goes before the old page 2 + ``` + + Delete page 4: + + ``` + /book edit delete 4 + ``` + + Sign the current writable book: + + ``` + /book sign Meeting Notes + ``` + +</details> + <details> <summary><code>bed</code></summary>