Skip to content

PlayerEditBookEvent ​

class · pocketmine\event\player\PlayerEditBookEvent · source

Extends PlayerEvent
Implements Cancellable

Constants ​

ACTION_ADD_PAGE ​

php
public const ACTION_ADD_PAGE = 1

ACTION_DELETE_PAGE ​

php
public const ACTION_DELETE_PAGE = 2

ACTION_REPLACE_PAGE ​

php
public const ACTION_REPLACE_PAGE = 0

ACTION_SIGN_BOOK ​

php
public const ACTION_SIGN_BOOK = 4

ACTION_SWAP_PAGES ​

php
public const ACTION_SWAP_PAGES = 3

Methods ​

__construct() ​

php
public function __construct(\pocketmine\player\Player $player, \pocketmine\item\WritableBookBase $oldBook, \pocketmine\item\WritableBookBase $newBook, int $action, array $modifiedPages)

getAction() ​

php
public function getAction() : int

Returns the action of the event.

getModifiedPages() ​

php
public function getModifiedPages() : array

Returns an array containing the page IDs of modified pages.

getNewBook() ​

php
public function getNewBook() : \pocketmine\item\WritableBookBase

Returns the book after it was modified. The new book may be a written book, if the book was signed.

getOldBook() ​

php
public function getOldBook() : \pocketmine\item\WritableBookBase

Returns the book before it was modified.

setNewBook() ​

php
public function setNewBook(\pocketmine\item\WritableBookBase $book) : void

Sets the new book as the given instance.

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