Can't change BookMeta

Discussion in 'Spigot Plugin Development' started by BorisTheTerrible, May 10, 2016.

  1. I am simply trying to change book meta whenever a player signs a book. However, it does not seem to changing anything at all. According to the javadocs, the event should be running whenever a player signs a book.

    Code (Text):
    @EventHandler(priority = EventPriority.HIGH)
        public void playerEditBookEvent(PlayerEditBookEvent event)
        {
            BookMeta bookMeta = event.getNewBookMeta();
           
            ArrayList<String> lore = new ArrayList<>();
            lore.add("lore 1");
            lore.add("lore 2");
            lore.add("lore 3");
           
            bookMeta.setLore(lore);
            bookMeta.setAuthor("Author");
            bookMeta.setTitle("Title");
            bookMeta.setDisplayName("DisplayName");
            event.setNewBookMeta(bookMeta);
        }
     
  2. Did you register your listener? Maybe add a debug message first to make sure, that your event is actually called.
     
  3. The event was removed indefinitely because it was causing issues with compiling the 1.9 update. SPIGOT-1550 is open for it.
     
  4. So is there no replacement? They just though, "ahhh f*ck it, no one will care if we just remove a whole event?"
     
  5. If they've had issues with it, it's understandable that they removed it for now. The issue Jikoo posted says that it's only a minor bug so bad luck for you^^
     
  6. MiniDigger

    Supporter