Trying to get bookmeta data to save

Discussion in 'Plugin Development' started by rourke750, May 16, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    rourke750

    so i have this:
    EventHandler
    public void OnPlayerFirstJoin(PlayerJoinEvent event){
    Boolean first = event.getPlayer().hasPlayedBefore();

    if (first == true){
    return;
    }
    Player player= event.getPlayer();
    Inventory inv= player.getInventory();

    ItemStack book= new ItemStack(Material.WRITTEN_BOOK);
    BookMeta sbook= (BookMeta)book.getItemMeta();
    sbook.setTitle(config_.getTitle());
    sbook.setAuthor(config_.getAuthor());
    sbook.setPages(config_.getPages());

    book.setItemMeta(sbook);

    inv.addItem(book);



    }

    When i first log in the book is there but the author isnt, or text, or the title.
     
  2. Offline

    chasechocolate

    There may be an error in one of your methods from the "config_" variable.
     
  3. How did you define config_?
     
Thread Status:
Not open for further replies.

Share This Page