Interface BookMeta

All Superinterfaces:
Cloneable, ConfigurationSerializable, ItemMeta, PersistentDataHolder, WritableBookMeta

public interface BookMeta extends WritableBookMeta
Represents a Material.WRITTEN_BOOK) that can have a title, an author, and pages.
  • Method Details

    • hasTitle

      boolean hasTitle()
      Checks for the existence of a title in the book.
      Returns:
      true if the book has a title
    • getTitle

      @Nullable String getTitle()
      Gets the title of the book.

      Plugins should check that hasTitle() returns true before calling this method.

      Returns:
      the title of the book
    • setTitle

      boolean setTitle(@Nullable String title)
      Sets the title of the book.

      Limited to 32 characters. Removes title when given null.

      Parameters:
      title - the title to set
      Returns:
      true if the title was successfully set
    • hasAuthor

      boolean hasAuthor()
      Checks for the existence of an author in the book.
      Returns:
      true if the book has an author
    • getAuthor

      @Nullable String getAuthor()
      Gets the author of the book.

      Plugins should check that hasAuthor() returns true before calling this method.

      Returns:
      the author of the book
    • setAuthor

      void setAuthor(@Nullable String author)
      Sets the author of the book. Removes author when given null.
      Parameters:
      author - the author to set
    • hasGeneration

      boolean hasGeneration()
      Checks for the existence of generation level in the book.
      Returns:
      true if the book has a generation level
    • getGeneration

      @Nullable BookMeta.Generation getGeneration()
      Gets the generation of the book.

      Plugins should check that hasGeneration() returns true before calling this method.

      Returns:
      the generation of the book
    • setGeneration

      void setGeneration(@Nullable BookMeta.Generation generation)
      Sets the generation of the book. Removes generation when given null.
      Parameters:
      generation - the generation to set
    • clone

      @NotNull BookMeta clone()
      Specified by:
      clone in interface ItemMeta
      Specified by:
      clone in interface WritableBookMeta
    • spigot

      @NotNull BookMeta.Spigot spigot()