[Written Books] How I can make it?

Discussion in 'Plugin Development' started by LightcraftLP, Oct 8, 2013.

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

    LightcraftLP

    How I can make a Item/ an ItemStack what are a written book! But I want to make a custom Text with Colors and co.! How I can make it in Java? So first I have easy make this Item but which Material it is? I don't know!

    Code:text
    1.  
    2. ItemStack ibook = new ItemStack(Material.???);
    3. ItemMeta ibook_meta = navi.getItemMeta();
    4. ibook.setDisplayName(ChatColor.RED + "Info book!");
    5.  


    Thanks for Help!

    *How I can make AN Item / an ItemStack what that , are a written book!

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  2. Offline

    metalhedd

    ItemStack book = new ItemStack(Material.WRITTEN_BOOK);
    BookMeta meta = (BookMeta) book.getItemMeta();
    meta.setAuthor("yadda");
    meta.setTitle("Yadda");
    meta.setPage(1, "Yadda.");
    book.setItemMeta(meta);
     
  3. Offline

    LightcraftLP

    Thanks, I 'ill test it later! One question!

    meta.setPage(1, ""); What is the 1? the first Page? Or the first Line!

    And is there working "ChatColor.COLOR" ?
     
  4. Offline

    Garris0n

    Javadocs.
     
Thread Status:
Not open for further replies.

Share This Page