Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

"Pages" book tag not processing properly?


Recommended Posts

so I created a "makeBook" method that adds a written book with information in it to a players inventory;

public static void makeBook(EntityPlayer player, String title, String author,String... pages)
        NBTTagList pagesTag = new NBTTagList();
        NBTTagCompound compound = new NBTTagCompound();

        for(int i = 0; i < pages.length; )
            pagesTag.appendTag(new NBTTagString(pages[i]));

        ItemStack book = new ItemStack(Items.WRITTEN_BOOK);

and then I pass this line of code in another class:

makeBook(player,"title","author","CHAPTER 1 In this world, all around us there is a force");

and no matter if I add \n or any other thing like that the book always looks like this


(the title and author work however)

any ideas how I make it A; display all the text and B; format it

thanks in advance


Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.