The ItemBookComponent class in @minecraft/server.
Class in @minecraft/server
Extends ItemComponent
import { ItemBookComponent } from '@minecraft/server';Constructor
Section titled “Constructor”protected constructor();Properties
Section titled “Properties”author
Section titled “author”read-only optional
readonly author?: string;contents
Section titled “contents”read-only
readonly contents: (string | undefined)[];isSigned
Section titled “isSigned”read-only
readonly isSigned: boolean;pageCount
Section titled “pageCount”read-only
readonly pageCount: number;rawContents
Section titled “rawContents”read-only
readonly rawContents: (RawMessage | undefined)[];Types
read-only optional
readonly title?: string;componentId
Section titled “componentId”static read-only
static readonly componentId = 'minecraft:book';Methods
Section titled “Methods”getPageContent
Section titled “getPageContent”getPageContent(pageIndex: number): string | undefined;Parameters
pageIndexnumber
Returns
string | undefinedgetRawPageContent
Section titled “getRawPageContent”getRawPageContent(pageIndex: number): RawMessage | undefined;Parameters
pageIndexnumber
Returns
RawMessage | undefinedTypes
insertPage
Section titled “insertPage”insertPage(pageIndex: number, content: (RawMessage | string)[] | RawMessage | string): void;Parameters
pageIndexnumbercontent(RawMessage | string)[] | RawMessage | string
Types
removePage
Section titled “removePage”removePage(pageIndex: number): void;Parameters
pageIndexnumber
setContents
Section titled “setContents”setContents(contents: ((RawMessage | string)[] | RawMessage | string)[]): void;Parameters
contents((RawMessage | string)[] | RawMessage | string)[]
Types
setPageContent
Section titled “setPageContent”setPageContent(pageIndex: number, content: (RawMessage | string)[] | RawMessage | string): void;Parameters
pageIndexnumbercontent(RawMessage | string)[] | RawMessage | string
Types
signBook
Section titled “signBook”signBook(title: string, author: string): void;Parameters
titlestringauthorstring
Inherited
Section titled “Inherited”From ItemComponent: typeId, isValid