Package org.bukkit.event.player

# Class PlayerEditBookEvent

java.lang.Object
org.bukkit.event.Event
org.bukkit.event.player.PlayerEvent
org.bukkit.event.player.PlayerEditBookEvent

All Implemented Interfaces:
  `Cancellable`

public class PlayerEditBookEvent extends PlayerEvent implements Cancellable
Called when a player edits or signs a book and quill item. If the event is cancelled, no changes are made to the BookMeta

## Nested Class Summary

## Nested classes/interfaces inherited from class org.bukkit.event.Event

`Event.Result`

## Field Summary

### Fields inherited from class org.bukkit.event.player.PlayerEvent

`player`

## Constructor Summary

Constructors
Constructor
Description
`PlayerEditBookEvent(@NotNull Player who, int slot, @NotNull BookMeta previousBookMeta, @NotNull BookMeta newBookMeta, boolean isSigning)`

## Method Summary

Modifier and Type
Method
Description
`static @NotNull HandlerList`
`getHandlerList()`
`@NotNull HandlerList`
`getHandlers()`
`@NotNull BookMeta`
`getNewBookMeta()`
Gets the book meta that the player is attempting to add to the book.
`@NotNull BookMeta`
`getPreviousBookMeta()`
Gets the book meta currently on the book.
`int`
`getSlot()`
Deprecated.
books may be signed from off hand
`boolean`
`isCancelled()`
Gets the cancellation state of this event.
`boolean`
`isSigning()`
Gets whether or not the book is being signed.
`void`
`setCancelled(boolean cancel)`
Sets the cancellation state of this event.
`void`
`setNewBookMeta(@NotNull BookMeta newBookMeta)`
Sets the book meta that will actually be added to the book.
`void`
`setSigning(boolean signing)`
Sets whether or not the book is being signed.

### Methods inherited from class org.bukkit.event.player.PlayerEvent

`getPlayer`

### Methods inherited from class org.bukkit.event.Event

`callEvent, getEventName, isAsynchronous`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### PlayerEditBookEvent

public PlayerEditBookEvent(@NotNull @NotNull Player who, int slot, @NotNull @NotNull BookMeta previousBookMeta, @NotNull @NotNull BookMeta newBookMeta, boolean isSigning)

## Method Details

### getPreviousBookMeta

@NotNull public @NotNull BookMeta getPreviousBookMeta()
Gets the book meta currently on the book.

Note: this is a copy of the book meta. You cannot use this object to change the existing book meta.

Returns:
  the book meta currently on the book

### getNewBookMeta

@NotNull public @NotNull BookMeta getNewBookMeta()
Gets the book meta that the player is attempting to add to the book.

Note: this is a copy of the proposed new book meta. Use `setNewBookMeta(BookMeta)` to change what will actually be added to the book.

Returns:
  the book meta that the player is attempting to add

### getSlot

@Deprecated public int getSlot()
Deprecated.
books may be signed from off hand
Gets the inventory slot number for the book item that triggered this event.

This is a slot number on the player's hotbar in the range 0-8, or -1 for off hand.

Returns:
  the inventory slot number that the book item occupies

### setNewBookMeta

public void setNewBookMeta(@NotNull @NotNull BookMeta newBookMeta) throws IllegalArgumentException
Sets the book meta that will actually be added to the book.

Parameters:
  `newBookMeta` - new book meta
Throws:
  `IllegalArgumentException` - if the new book meta is null

### isSigning

public boolean isSigning()
Gets whether or not the book is being signed. If a book is signed the Material changes from BOOK_AND_QUILL to WRITTEN_BOOK.

Returns:
  true if the book is being signed

### setSigning

public void setSigning(boolean signing)
Sets whether or not the book is being signed. If a book is signed the Material changes from BOOK_AND_QUILL to WRITTEN_BOOK.

Parameters:
  `signing` - whether or not the book is being signed.

### getHandlers

@NotNull public @NotNull HandlerList getHandlers()

Specified by:
  `getHandlers` in class `Event`

### getHandlerList

@NotNull public static @NotNull HandlerList getHandlerList()

### isCancelled

public boolean isCancelled()
Description copied from interface: `Cancellable`
Gets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins

Specified by:
  `isCancelled` in interface `Cancellable`
Returns:
  true if this event is cancelled

### setCancelled

public void setCancelled(boolean cancel)
Description copied from interface: `Cancellable`
Sets the cancellation state of this event. A cancelled event will not be executed in the server, but will still pass to other plugins.

Specified by:
  `setCancelled` in interface `Cancellable`
Parameters:
  `cancel` - true if you wish to cancel this event