Skip to content

WritableBookBase ​

abstract class · pocketmine\item\WritableBookBase · source

Extends Item

Constants ​

TAG_PAGES ​

php
public const TAG_PAGES = "pages"

TAG_PAGE_PHOTONAME ​

php
public const TAG_PAGE_PHOTONAME = "photoname"

TAG_PAGE_TEXT ​

php
public const TAG_PAGE_TEXT = "text"

Methods ​

__construct() ​

php
public function __construct(\pocketmine\item\ItemIdentifier $identifier, string $name)

addPage() ​

php
public function addPage(int $pageId) : self

Adds a new page with the given page ID. Creates a new page for every page between the given ID and existing pages that doesn't yet exist.

deletePage() ​

php
public function deletePage(int $pageId) : self

Deletes an existing page with the given page ID.

deserializeCompoundTag() protected ​

php
protected function deserializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

getMaxStackSize() ​

php
public function getMaxStackSize() : int

getPageText() ​

php
public function getPageText(int $pageId) : string

Returns a string containing the content of a page (which could be empty), or null if the page doesn't exist.

getPages() ​

php
public function getPages() : array

Returns an array containing all pages of this book.

insertPage() ​

php
public function insertPage(int $pageId, string $pageText = "") : self

Inserts a new page with the given text and moves other pages upwards.

pageExists() ​

php
public function pageExists(int $pageId) : bool

Returns whether the given page exists in this book.

serializeCompoundTag() protected ​

php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : void

setPageText() ​

php
public function setPageText(int $pageId, string $pageText) : self

Sets the text of a page in the book. Adds the page if the page does not yet exist.

setPages() ​

php
public function setPages(array $pages) : self

swapPages() ​

php
public function swapPages(int $pageId1, int $pageId2) : bool

Switches the text of two pages with each other.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.