Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6557

PlayerEditBookEvent::setNewBookMeta does not update meta (or at least lore)

    XMLWordPrintable

Details

    • Bug
    • Status: Resolved (View Workflow)
    • Major
    • Resolution: Fixed
    • None
    • None
    • Debian 10

    • This server is running CraftBukkit version 3138-Spigot-66f9d3c-77058c7 (MC: 1.17) (Implementing API version 1.17-R0.1-SNAPSHOT)
    • Yes

    Description

      Signing or editing a book triggers the PlayerEditBookEvent (I've checked), but the new book's BookMeta is not updated correctly. At the very least, setting the book's lore does not work.

       

      Steps to reproduce:

      1. Use the code below to listen for the event and update lore.
      2. Sign or save a book (/give @p writable_book -> right click anywhere -> write something and sign/save the book).
      3. The book should show "Lore Test" below the usual text when hovering over the item, but it doesn't.

       

      @EventHandler
      public void onPlayerEditBook(PlayerEditBookEvent e) {
        BookMeta meta = e.getNewBookMeta();
        List<String> newLore = new ArrayList<>();
        newLore.add("Lore Test");
        meta.setLore(newLore);
        e.setNewBookMeta(meta);
      }

      Attachments

        Activity

          People

            Unassigned Unassigned
            bahm bahm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: