WritableBookBase
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) : selfAdds 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) : selfDeletes an existing page with the given page ID.
deserializeCompoundTag() protected
php
protected function deserializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : voidgetMaxStackSize()
php
public function getMaxStackSize() : intgetPageText()
php
public function getPageText(int $pageId) : stringReturns 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() : arrayReturns an array containing all pages of this book.
insertPage()
php
public function insertPage(int $pageId, string $pageText = "") : selfInserts a new page with the given text and moves other pages upwards.
pageExists()
php
public function pageExists(int $pageId) : boolReturns whether the given page exists in this book.
serializeCompoundTag() protected
php
protected function serializeCompoundTag(\pocketmine\nbt\tag\CompoundTag $tag) : voidsetPageText()
php
public function setPageText(int $pageId, string $pageText) : selfSets 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) : selfswapPages()
php
public function swapPages(int $pageId1, int $pageId2) : boolSwitches the text of two pages with each other.
