Solved What's the difference

Discussion in 'Spigot Plugin Development' started by Bobcatsss, Jan 20, 2020.

Thread Status:
Not open for further replies.
  1. What's the difference between WRITABLE_BOOK and WRITTEN_BOOK
    Currently added a really simple feature to one of my plugins and i keep getting "invalid meta" when opening a book

    Code (Text):
        @EventHandler
        public void onEdit(PlayerEditBookEvent event) {
            Player player = event.getPlayer();
            ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
            BookMeta meta = event.getNewBookMeta();
            if(meta.getAuthor() == null) {
                meta.setAuthor(player.getName());
            }
            book.setItemMeta(meta);
            String id = plugin.randomID();
            plugin.addBook(id, book);
            sendMessage(player.getName(), id);
        }
    When i then give this saved book to a player it has invalid meta.
     
  2. A writable book, is one that isnt sealed by a player or isn't 'finished'

    A Written book is one that would have been sealed by a player. Its not editable.

    Someone correct me if I am wrong.
     
    • Like Like x 1
    • Agree Agree x 1
    • Informative Informative x 1
  3. +1 that's all about there is to it
     
    • Like Like x 1
  4. Thanks for the replies that fixed my issue.
     
    • Friendly Friendly x 2
Thread Status:
Not open for further replies.