Solved How to add a new line to a book?

Discussion in 'Spigot Plugin Development' started by Evlerr, Jun 4, 2017.

  1. Hey,

    Just trying to figure out how I can add a line to a book (doing it through a config) any help is appreciated.

    This is what I have so far.

    Code (Text):
            ItemStack book = new ItemStack(Material.WRITTEN_BOOK, 1);
            BookMeta bookMeta = (BookMeta) book.getItemMeta();
            for (String lines : AzruHub.plugin.getConfig().getStringList("book-contents.lines")) {
                bookMeta.addPage(lines);
            }
            book.setItemMeta(bookMeta);
    But
    Code (Text):
    bookMeta#addPage
    adds a new page when I just want to add a new line.