Interface BookMeta
- All Superinterfaces:
- Book,- Buildable<Book,,- Book.Builder> - Cloneable,- ConfigurationSerializable,- net.kyori.examination.Examinable,- ItemMeta,- PersistentDataHolder,- WritableBookMeta
Material.WRITTEN_BOOK that can have a title, an author,
 and pages.
 
 Before using this type, make sure to check the itemstack's material with
 ItemStack.getType(). instanceof on
 the meta instance is not sufficient due to unusual inheritance
 with relation to WritableBookMeta.
- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic interfacestatic enumRepresents the generation (or level of copying) of a written bookstatic classNested classes/interfaces inherited from interface net.kyori.adventure.inventory.BookBook.Builder
- 
Method SummaryModifier and TypeMethodDescriptionvoidDeprecated.voidAdds new pages to the end of the book.author()Gets the author of the book.Sets the author of the book.clone()Gets the author of the book.Gets the generation of the book.getPage(int page) Deprecated.usepage(int)getPages()Deprecated.useBook.pages()getTitle()Gets the title of the book.booleanChecks for the existence of an author in the book.booleanChecks for the existence of generation level in the book.booleanhasTitle()Checks for the existence of a title in the book.page(int page) Gets the specified page in the book.voidSets the specified page in the book.voidSets the author of the book.voidsetGeneration(@Nullable BookMeta.Generation generation) Sets the generation of the book.voidDeprecated.voidDeprecated.voidDeprecated.useBook.pages(List)booleanSets the title of the book.spigot()title()Gets the title of the book.Sets the title of the book.Create a new builder initialized with the attributes of this book.Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserializeMethods inherited from interface net.kyori.examination.ExaminableexaminableName, examinableProperties, examineMethods inherited from interface org.bukkit.inventory.meta.ItemMetaaddAttributeModifier, addEnchant, addItemFlags, displayName, displayName, getAsComponentString, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getDisplayNameComponent, getEnchantLevel, getEnchantmentGlintOverride, getEnchants, getFood, getItemFlags, getItemName, getLocalizedName, getLore, getLoreComponents, getMaxStackSize, getRarity, getTool, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchantmentGlintOverride, hasEnchants, hasFood, hasItemFlag, hasItemName, hasLocalizedName, hasLore, hasMaxStackSize, hasRarity, hasTool, isFireResistant, isHideTooltip, isUnbreakable, itemName, itemName, lore, lore, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeEnchantments, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setDisplayNameComponent, setEnchantmentGlintOverride, setFireResistant, setFood, setHideTooltip, setItemName, setLocalizedName, setLore, setLoreComponents, setMaxStackSize, setRarity, setTool, setUnbreakable, setVersionMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainerMethods inherited from interface org.bukkit.inventory.meta.WritableBookMetagetPageCount, hasPages
- 
Method Details- 
hasTitleboolean hasTitle()Checks for the existence of a title in the book.- Returns:
- true if the book has a title
 
- 
getTitleGets the title of the book.Plugins should check that hasTitle() returns true before calling this method. - Returns:
- the title of the book
 
- 
setTitleSets the title of the book.Limited to 32 characters. Removes title when given null. - Parameters:
- title- the title to set
- Returns:
- true if the title was successfully set
 
- 
hasAuthorboolean hasAuthor()Checks for the existence of an author in the book.- Returns:
- true if the book has an author
 
- 
getAuthorGets the author of the book.Plugins should check that hasAuthor() returns true before calling this method. - Returns:
- the author of the book
 
- 
setAuthorSets the author of the book. Removes author when given null.- Parameters:
- author- the author to set
 
- 
hasGenerationboolean hasGeneration()Checks for the existence of generation level in the book.- Returns:
- true if the book has a generation level
 
- 
getGenerationGets the generation of the book.Plugins should check that hasGeneration() returns true before calling this method. - Returns:
- the generation of the book
 
- 
setGenerationSets the generation of the book. Removes generation when given null.- Parameters:
- generation- the generation to set
 
- 
clone- Specified by:
- clonein interface- ItemMeta
- Specified by:
- clonein interface- WritableBookMeta
 
- 
getPageDeprecated.usepage(int)Description copied from interface:WritableBookMetaGets the specified page in the book. The given page must exist.Pages are 1-indexed. - Specified by:
- getPagein interface- WritableBookMeta
- Parameters:
- page- the page number to get, in range [1, getPageCount()]
- Returns:
- the page from the book
 
- 
setPageDeprecated.Description copied from interface:WritableBookMetaSets the specified page in the book. Pages of the book must be contiguous.The data can be up to 1024 characters in length, additional characters are truncated. Pages are 1-indexed. - Specified by:
- setPagein interface- WritableBookMeta
- Parameters:
- page- the page number to set, in range [1, getPageCount()]
- data- the data to set for that page
 
- 
getPagesDeprecated.useBook.pages()Description copied from interface:WritableBookMetaGets all the pages in the book.- Specified by:
- getPagesin interface- WritableBookMeta
- Returns:
- list of all the pages in the book
 
- 
setPagesDeprecated.useBook.pages(List)Description copied from interface:WritableBookMetaClears the existing book pages, and sets the book to use the provided pages. Maximum 100 pages with 1024 characters per page.- Specified by:
- setPagesin interface- WritableBookMeta
- Parameters:
- pages- A list of pages to set the book to use
 
- 
setPagesDeprecated.Description copied from interface:WritableBookMetaClears the existing book pages, and sets the book to use the provided pages. Maximum 100 pages with 1024 characters per page.- Specified by:
- setPagesin interface- WritableBookMeta
- Parameters:
- pages- A list of strings, each being a page
 
- 
addPageDeprecated.Description copied from interface:WritableBookMetaAdds new pages to the end of the book. Up to a maximum of 100 pages with 1024 characters per page.- Specified by:
- addPagein interface- WritableBookMeta
- Parameters:
- pages- A list of strings, each being a page
 
- 
titleGets the title of the book.Plugins should check that hasTitle() returns true before calling this method. 
- 
title@Contract(value="_ -> this", pure=false) @NotNull @NotNull BookMeta title(@Nullable Component title) Sets the title of the book.Limited to 32 characters. Removes title when given null. 
- 
authorGets the author of the book.Plugins should check that hasAuthor() returns true before calling this method. 
- 
author@Contract(value="_ -> this", pure=false) @NotNull @NotNull BookMeta author(@Nullable Component author) Sets the author of the book. Removes author when given null.
- 
pageGets the specified page in the book. The page must exist.Pages are 1-indexed. - Parameters:
- page- the page number to get, in range [1, getPageCount()]
- Returns:
- the page from the book
 
- 
pageSets the specified page in the book. Pages of the book must be contiguous.The data can be up to 1024 characters in length, additional characters are truncated. Pages are 1-indexed. - Parameters:
- page- the page number to set, in range [1, getPageCount()]
- data- the data to set for that page
 
- 
addPagesAdds new pages to the end of the book. Up to a maximum of 100 pages with 1024 characters per page.- Parameters:
- pages- A list of strings, each being a page
 
- 
toBuilderDescription copied from interface:net.kyori.adventure.inventory.BookCreate a new builder initialized with the attributes of this book.
- 
spigot
 
- 
addPages(net.kyori.adventure.text.Component...)