Package org.bukkit.inventory.meta
Interface BookMeta
- All Superinterfaces:
- Cloneable,- ConfigurationSerializable,- ItemMeta,- PersistentDataHolder
Represents a book (
Material.WRITABLE_BOOK or Material.WRITTEN_BOOK) that can have a title, an author, and pages.- 
Nested Class SummaryNested ClassesModifier and TypeInterfaceDescriptionstatic enumRepresents the generation (or level of copying) of a written bookstatic class
- 
Method SummaryModifier and TypeMethodDescriptionvoidAdds new pages to the end of the book.clone()Gets the author of the book.Gets the generation of the book.getPage(int page) Gets the specified page in the book.intGets the number of pages in the book.getPages()Gets all the pages in the book.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.booleanhasPages()Checks for the existence of pages in the book.booleanhasTitle()Checks for the existence of a title in the book.voidSets the author of the book.voidsetGeneration(BookMeta.Generation generation) Sets the generation of the book.voidSets the specified page in the book.voidClears the existing book pages, and sets the book to use the provided pages.voidClears the existing book pages, and sets the book to use the provided pages.booleanSets the title of the book.spigot()Methods inherited from interface org.bukkit.configuration.serialization.ConfigurationSerializableserializeMethods inherited from interface org.bukkit.inventory.meta.ItemMetaaddAttributeModifier, addEnchant, addItemFlags, getAsString, getAttributeModifiers, getAttributeModifiers, getAttributeModifiers, getCustomModelData, getCustomTagContainer, getDisplayName, getEnchantLevel, getEnchants, getItemFlags, getLocalizedName, getLore, hasAttributeModifiers, hasConflictingEnchant, hasCustomModelData, hasDisplayName, hasEnchant, hasEnchants, hasItemFlag, hasLocalizedName, hasLore, isUnbreakable, removeAttributeModifier, removeAttributeModifier, removeAttributeModifier, removeEnchant, removeItemFlags, setAttributeModifiers, setCustomModelData, setDisplayName, setLocalizedName, setLore, setUnbreakable, setVersionMethods inherited from interface org.bukkit.persistence.PersistentDataHoldergetPersistentDataContainer
- 
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
 
- 
hasPagesboolean hasPages()Checks for the existence of pages in the book.- Returns:
- true if the book has pages
 
- 
getPageGets the specified page in the book. The given page must exist.Pages are 1-indexed. - Parameters:
- page- the page number to get, in range [1, getPageCount()]
- Returns:
- the page from the book
 
- 
setPageSets the specified page in the book. Pages of the book must be contiguous.The data can be up to 256 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
 
- 
getPagesGets all the pages in the book.- Returns:
- list of all the pages in the book
 
- 
setPagesClears the existing book pages, and sets the book to use the provided pages. Maximum 100 pages with 256 characters per page.- Parameters:
- pages- A list of pages to set the book to use
 
- 
setPagesClears the existing book pages, and sets the book to use the provided pages. Maximum 50 pages with 256 characters per page.- Parameters:
- pages- A list of strings, each being a page
 
- 
addPageAdds new pages to the end of the book. Up to a maximum of 50 pages with 256 characters per page.- Parameters:
- pages- A list of strings, each being a page
 
- 
getPageCountint getPageCount()Gets the number of pages in the book.- Returns:
- the number of pages in the book
 
- 
clone
- 
spigot
 
-