public class PlayerEditBookEvent extends PlayerEvent implements Cancellable
Event.Result
player
Constructor and Description |
---|
PlayerEditBookEvent(@NotNull Player who,
int slot,
@NotNull BookMeta previousBookMeta,
@NotNull BookMeta newBookMeta,
boolean isSigning) |
Modifier and Type | Method and 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.
|
getPlayer
callEvent, getEventName, isAsynchronous
@NotNull public @NotNull BookMeta getPreviousBookMeta()
Note: this is a copy of the book meta. You cannot use this object to change the existing book meta.
@NotNull public @NotNull BookMeta getNewBookMeta()
Note: this is a copy of the proposed new book meta. Use setNewBookMeta(BookMeta)
to change what will actually be added to the
book.
@Deprecated public int getSlot()
This is a slot number on the player's hotbar in the range 0-8, or -1 for off hand.
public void setNewBookMeta(@NotNull @NotNull BookMeta newBookMeta) throws IllegalArgumentException
newBookMeta
- new book metaIllegalArgumentException
- if the new book meta is nullpublic boolean isSigning()
public void setSigning(boolean signing)
signing
- whether or not the book is being signed.@NotNull public @NotNull HandlerList getHandlers()
getHandlers
in class Event
@NotNull public static @NotNull HandlerList getHandlerList()
public boolean isCancelled()
Cancellable
isCancelled
in interface Cancellable
public void setCancelled(boolean cancel)
Cancellable
setCancelled
in interface Cancellable
cancel
- true if you wish to cancel this eventCopyright © 2021. All rights reserved.