Class BookBuilder

java.lang.Object
io.rhythmknights.coreapi.modal.builder.item.BaseItemBuilder<BookBuilder>
io.rhythmknights.coreapi.modal.builder.item.BookBuilder

public class BookBuilder extends BaseItemBuilder<BookBuilder>
Item builder for Material.WRITTEN_BOOK and Material.WRITTEN_BOOK only
Since:
3.0.1
  • Method Details

    • author

      @NotNull @Contract("_ -> this") public @NotNull BookBuilder author(@Nullable @Nullable net.kyori.adventure.text.Component author)
      Sets the author of the book. Removes author when given null.
      Parameters:
      author - the author to set
      Returns:
      BookBuilder
      Since:
      3.0.1
    • generation

      @NotNull @Contract("_ -> this") public @NotNull BookBuilder generation(@Nullable org.bukkit.inventory.meta.BookMeta.Generation generation)
      Sets the generation of the book. Removes generation when given null.
      Parameters:
      generation - the generation to set
      Returns:
      BookBuilder
      Since:
      3.0.1
    • page

      @NotNull @Contract("_ -> this") public @NotNull BookBuilder page(@NotNull @NotNull net.kyori.adventure.text.Component... pages)
      Adds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.
      Parameters:
      pages - list of pages
      Returns:
      BookBuilder
      Since:
      3.0.1
    • page

      @NotNull @Contract("_ -> this") public @NotNull BookBuilder page(@NotNull @NotNull List<net.kyori.adventure.text.Component> pages)
      Adds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.
      Parameters:
      pages - list of pages
      Returns:
      BookBuilder
      Since:
      3.0.1
    • page

      @NotNull @Contract("_, _ -> this") public @NotNull BookBuilder page(int page, @NotNull @NotNull net.kyori.adventure.text.Component data)
      Sets the specified page in the book. Pages of the book must be contiguous.

      The data can be up to 256 characters in length, additional characters are truncated.

      Pages are 1-indexed.

      Parameters:
      page - the page number to set, in range [1, WritableBookMeta.getPageCount()]
      data - the data to set for that page
      Returns:
      BookBuilder
      Since:
      3.0.1
    • title

      @NotNull @Contract("_ -> this") public @NotNull BookBuilder title(@Nullable @Nullable net.kyori.adventure.text.Component title)
      Sets the title of the book.

      Limited to 32 characters. Removes title when given null.

      Parameters:
      title - the title to set
      Returns:
      BookBuilder
      Since:
      3.0.1