As the title says, I would like to have a custom command give the player a signed book with some filled pages. I have the book being given to the player, with a title and author; however, I am having issues with how to add the pages. When I try to add a page, all I get is red text saying "* Invalid book tag *". Below is the code I have so far:
ItemStack stack = new ItemStack(Items.WRITTEN_BOOK);
stack.setTag(new CompoundTag());
stack.getTag().putString("author", "AOT Command");
stack.getTag().putString("title", "Registry Out");
stack.getTag().putString("pages", "testing");
player.drop(stack, false, false);