When present on an item, this item is a book item. Can access and modify the contents of the book and sign it.

Hierarchy (View Summary)

Constructors

Properties

author?: string

The name of the author of the book if it is signed, otherwise undefined.

This property can throw when used.

InvalidItemStackError

contents: (undefined | string)[]

The contents of pages in the book that are in string format. Entries not in string format will be undefined.

This property can throw when used.

InvalidItemStackError

isSigned: boolean

Determines whether the book has been signed or not.

This property can throw when used.

InvalidItemStackError

isValid: boolean

Returns whether the component is valid. A component is considered valid if its owner is valid, in addition to any addition to any additional validation required by the component.

pageCount: number

The amount of pages the book has.

This property can throw when used.

InvalidItemStackError

rawContents: (undefined | RawMessage)[]

The contents of pages in the book that are in RawMessage format. Entries not in RawMessage format will be undefined.

This property can throw when used.

InvalidItemStackError

title?: string

The title of the book if it is signed, otherwise undefined.

This property can throw when used.

InvalidItemStackError

typeId: string

Identifier of the component.

componentId: "minecraft:book" = 'minecraft:book'

Methods